diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-03 14:32:36 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-03 14:32:36 +0800 |
commit | f01c33f6bffec99c474f109a31c8481012a83075 (patch) | |
tree | feb254dc325224cdbf9ee40c6494d1e7ce334ee8 /common | |
parent | b25a423c98a1ef5763b9810d554417546214417d (diff) | |
download | pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.gz pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.bz2 pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.lz pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.xz pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.tar.zst pttbbs-f01c33f6bffec99c474f109a31c8481012a83075.zip |
- (internal) change mail/log to specific API.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4070 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'common')
-rw-r--r-- | common/sys/file.c | 14 | ||||
-rw-r--r-- | common/sys/log.c | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/common/sys/file.c b/common/sys/file.c index 48b7fceb..9e993905 100644 --- a/common/sys/file.c +++ b/common/sys/file.c @@ -301,6 +301,20 @@ Link(const char *src, const char *dst) return Copy(src, dst); } +/** + * @param src file + * @param dst file + * @return 0 if success + */ +int +HardLink(const char *src, const char *dst) +{ + if (link(src, dst) == 0) + return 0; + + return Copy(src, dst); +} + /* ----------------------------------------------------- */ /* 檔案內容處理函數:以「行」為單位 */ /* ----------------------------------------------------- */ diff --git a/common/sys/log.c b/common/sys/log.c index 7923caca..bfaf2e13 100644 --- a/common/sys/log.c +++ b/common/sys/log.c @@ -9,7 +9,7 @@ int log_filef(const char *fn, int log_flag, const char *fmt,...) { - char msg[256]; + char msg[512]; va_list ap; va_start(ap, fmt); |