summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/sys/file.c14
-rw-r--r--common/sys/log.c2
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);