diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 21:01:35 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 21:01:35 +0800 |
commit | 116b6f11687f2d0153af1ae3e26534efea20e9fa (patch) | |
tree | e08df7af952583497c859d1e4c8543e990e223b7 /mbbsd | |
parent | 2d526ddb51fd710a62720679cf3c861cfe3385f5 (diff) | |
download | pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar.gz pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar.bz2 pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar.lz pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar.xz pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.tar.zst pttbbs-116b6f11687f2d0153af1ae3e26534efea20e9fa.zip |
don't call system() in simple case
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2643 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 2 | ||||
-rw-r--r-- | mbbsd/mail.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 2872b01b..ed3b9cec 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1324,7 +1324,7 @@ int cat_register(void) { if (system("cat register.new.tmp >> register.new") == 0 && - system("rm -f register.new.tmp") == 0) + unlink("register.new.tmp") == 0) vmsg("OK 嚕~~ 繼續去奮鬥吧!!"); else vmsg("沒辦法CAT過去呢 去檢查一下系統吧!!"); diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 4058224b..fee66464 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1637,9 +1637,8 @@ doforward(const char *direct, const fileheader_t * fh, int mode) char tmp_buf[128]; snprintf(fname, sizeof(fname), "/tmp/bbs.f%05d", (int)currpid); - snprintf(tmp_buf, sizeof(tmp_buf), - "cp %s/%s %s", direct, fh->filename, fname); - system(tmp_buf); + snprintf(tmp_buf, sizeof(tmp_buf), "%s/%s", direct, fh->filename); + copy_file(tmp_buf, fname); } else return -1; |