Leftover.
[sysvinit.git] / src / bootlogd.c
index 924f50292669f5ac43f9a157e94cf2d9c7ea2a10..8831923bd65d20727bc21a72d489060f28d18176 100644 (file)
@@ -108,7 +108,7 @@ void handler(int sig)
 /*
  *     Scan /dev and find the device name.
  */
-static int findtty(char *res, int rlen, dev_t dev)
+static int findtty(char *res, const char *startdir, int rlen, dev_t dev)
 {
        DIR             *dir;
        struct dirent   *ent;
@@ -198,7 +198,7 @@ int findpty(int *master, int *slave, char *name)
                }
                if (found) break;
        }
-       if (found < 0) return -1;
+       if (!found) return -1;
 
        if (name) strcpy(name, tty);
 
@@ -375,7 +375,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
                                break;
                        case '\n':
                                didnl = 1;
-                               dosync = syncalot;
+                               dosync = 1;
                                break;
                        case '\t':
                                line.pos += (line.pos / 8 + 1) * 8;
@@ -407,7 +407,9 @@ void writelog(FILE *fp, unsigned char *ptr, int len)
 
        if (dosync) {
                fflush(fp);
-               fdatasync(fileno(fp));
+               if (syncalot) {
+                       fdatasync(fileno(fp));
+               }
        }
 
        outptr += olen;