chiark / gitweb /
Give the magic `current time' constant used by `fw_log' a sensible name.
[fwd] / file.c
diff --git a/file.c b/file.c
index 88b76669cb9395858714afdc002d6e66669c242a..8b4f53309a5cf9698fb359e63053bf3a77705bd4 100644 (file)
--- a/file.c
+++ b/file.c
@@ -140,7 +140,7 @@ static reffd *file_nullref(void)
   else {
     int n;
     if ((n = open("/dev/null", O_RDWR)) < 0) {
-      fw_log(-1, "couldn't open `/dev/null': %s", strerror(errno));
+      fw_log(NOW, "couldn't open `/dev/null': %s", strerror(errno));
       return (0);
     }
     fdflags(n, O_NONBLOCK, O_NONBLOCK, FD_CLOEXEC, FD_CLOEXEC);
@@ -359,7 +359,7 @@ static endpt *file_endpt(fdata *f, const char *desc)
     case FTYPE_NAME: {
       int fd;
       if ((fd = open(f->in.u.name, O_RDONLY | O_NONBLOCK)) < 0) {
-       fw_log(-1, "[%s] couldn't open `%s' for reading: %s",
+       fw_log(NOW, "[%s] couldn't open `%s' for reading: %s",
               desc, f->in.u.name, strerror(errno));
        return (0);
       }
@@ -391,7 +391,7 @@ static endpt *file_endpt(fdata *f, const char *desc)
       if ((m & O_CREAT) &&
          (fd = open(f->out.u.name, m | O_EXCL, f->fa.mode)) < 0 &&
          (errno != EEXIST || (m & O_EXCL))) {
-       fw_log(-1, "[%s] couldn't create `%s': %s",
+       fw_log(NOW, "[%s] couldn't create `%s': %s",
               desc, f->out.u.name, strerror(errno));
        REFFD_DEC(in);
        return (0);
@@ -399,11 +399,11 @@ static endpt *file_endpt(fdata *f, const char *desc)
 
       if (fd != -1) {
        if (fattr_apply(f->out.u.name, &f->fa)) {
-         fw_log(-1, "[%s] couldn't apply file attributes to `%s': %s",
+         fw_log(NOW, "[%s] couldn't apply file attributes to `%s': %s",
                 desc, f->out.u.name, strerror(errno));
        }
       } else if ((fd = open(f->out.u.name, m & ~O_CREAT)) < 0) {
-       fw_log(-1, "[%s] couldn't open `%s': %s",
+       fw_log(NOW, "[%s] couldn't open `%s': %s",
               desc, f->out.u.name, strerror(errno));
        REFFD_DEC(in);
        return (0);