X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Foptr.c;h=c1ba8a97a7b9917249911745a77d527a5fefd6f2;hp=4d232422bde8af2c6bd757f69a8b32a8d0a9e162;hb=b45f51d61e911ac8a040bef1efda6afd82261e03;hpb=1227625a12a66e0ded78a1997c2d23f23202a382 diff --git a/dump/optr.c b/dump/optr.c index 4d23242..c1ba8a9 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -1,7 +1,8 @@ /* * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit - * Remy Card , 1994, 1995, 1996 + * Remy Card , 1994-1997 + * Stelian Pop , 1999 * */ @@ -39,7 +40,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; +#endif +static const char rcsid[] = + "$Id: optr.c,v 1.2 1999/10/11 12:53:22 stelian Exp $"; #endif /* not lint */ #include @@ -49,26 +54,18 @@ static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #include #include #include -#include #include -#ifdef __STDC__ #include #include #include -#endif -#include -#ifdef __STDC__ #include -#endif #include -#ifndef __STDC__ -#include -#endif #ifdef __linux__ #include #include #include +#include #endif #include "dump.h" @@ -184,7 +181,7 @@ struct group *gp; /* * Get the names from the group entry "operator" to notify. - */ + */ void set_operators() { @@ -265,13 +262,13 @@ static void sendmes(tty, message) char *tty, *message; { - char t[50], buf[BUFSIZ]; + char t[MAXPATHLEN], buf[BUFSIZ]; register char *cp; int lmsg = 1; FILE *f_tty; (void) strcpy(t, _PATH_DEV); - (void) strcat(t, tty); + (void) strncat(t, tty, sizeof t - strlen(_PATH_DEV) - 1); if ((f_tty = fopen(t, "w")) != NULL) { setbuf(f_tty, buf); @@ -313,7 +310,7 @@ timeest() if (tnow >= tschedule) { tschedule = tnow + 300; if (blockswritten < 500) - return; + return; deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing)) / blockswritten * tapesize; @@ -559,7 +556,7 @@ lastdump(arg) dt = fstabsearch(dtwalk->dd_name); dumpme = (dt != NULL && dt->fs_freq != 0 && - dtwalk->dd_ddate < tnow - (dt->fs_freq * SECSPERDAY)); + dtwalk->dd_ddate < tnow - (dt->fs_freq * 86400)); if (arg != 'w' || dumpme) (void) printf( "%c %8s\t(%6s) Last dump: Level %c, Date %s\n",