]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/log-file.c
Example: Fix the previous commit.
[libucw.git] / ucw / log-file.c
index 7bfeaa6822280946c46f07556e4c91be521cfb5b..ec05396c3dead9fad243308252d1f15927109fae 100644 (file)
@@ -40,7 +40,7 @@ do_log_switch(struct tm *tm)
   if (strcmp(name, log_filename))
     {
       strcpy(log_filename, name);
   if (strcmp(name, log_filename))
     {
       strcpy(log_filename, name);
-      fd = sh_open(name, O_WRONLY | O_CREAT | O_APPEND, 0666);
+      fd = ucw_open(name, O_WRONLY | O_CREAT | O_APPEND, 0666);
       if (fd < 0)
        die("Unable to open log file %s: %m", name);
       dup2(fd, 2);
       if (fd < 0)
        die("Unable to open log file %s: %m", name);
       dup2(fd, 2);
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
   log_init(argv[0]);
   log_file("/proc/self/fd/1");
   for (int i=1; i<argc; i++)
   log_init(argv[0]);
   log_file("/proc/self/fd/1");
   for (int i=1; i<argc; i++)
-    log(L_INFO, argv[i]);
+    msg(L_INFO, argv[i]);
   return 0;
 }
 
   return 0;
 }