summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-20 10:03:22 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-10-20 10:03:22 +0800
commitdac02d5bd1e21c5dae7308cdaf1ceb782e41d78b (patch)
tree0ca1bf6103b0339b945aaf6ca2920759f4dd17bb /mbbsd
parent7477caa6ffc9f8a2e0dbd752387b5da737c9745c (diff)
downloadpttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar.gz
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar.bz2
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar.lz
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar.xz
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.tar.zst
pttbbs-dac02d5bd1e21c5dae7308cdaf1ceb782e41d78b.zip
fix status read
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3227 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/cal.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c
index 736f41fe..a180a182 100644
--- a/mbbsd/cal.c
+++ b/mbbsd/cal.c
@@ -463,17 +463,15 @@ p_sysinfo(void)
struct rusage ru;
#ifdef __linux__
int vmdata=0, vmstk=0;
- {
- FILE * fp;
- char buf[128];
- if ((fp = fopen("/proc/self/status", "r"))) {
- while (fgets(buf, 128, fp) && vmdata==0 && vmstk==0) {
- sscanf(buf, "VmData: %d", &vmdata);
- sscanf(buf, "VmStk: %d", &vmstk);
- }
- fclose(fp);
+ FILE * fp;
+ char buf[128];
+ if ((fp = fopen("/proc/self/status", "r"))) {
+ while (fgets(buf, 128, fp)) {
+ sscanf(buf, "VmData: %d", &vmdata);
+ sscanf(buf, "VmStk: %d", &vmstk);
}
- }
+ fclose(fp);
+ }
#endif
getrusage(RUSAGE_SELF, &ru);
prints("°O¾ÐÅé¥Î¶q: "