FreeBSD Bugzilla – Attachment 11483 Details for
Bug 22612
crontab -e failures
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.44 KB, created by
Don Read
on 2000-11-05 05:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Don Read
Created:
2000-11-05 05:00:01 UTC
Size:
1.44 KB
patch
obsolete
>--- old/crontab.c Sat Nov 4 21:18:41 2000 >+++ crontab.c Sat Nov 4 22:09:41 2000 >@@ -43,7 +43,7 @@ > # include <locale.h> > #endif > >- >+#include <string.h> > #define NHEADER_LINES 3 > > >@@ -269,14 +269,16 @@ > fprintf(stderr, "\"%s\":%d: %s\n", Filename, LineNumber-1, msg); > } > >+/* dwr 2000-11-04 compare entire statbuf instead of mtime's >+ * (avoids some nasty #ifdef POSIX). >+ */ > > static void > edit_cmd() { > char n[MAX_FNAME], q[MAX_TEMPSTR], *editor; > FILE *f; > int ch, t, x; >- struct stat statbuf; >- time_t mtime; >+ struct stat statbuf, statprev; > WAIT_T waiter; > PID_T pid, xpid; > mode_t um; >@@ -340,12 +342,11 @@ > if (fclose(NewCrontab)) > err(ERROR_EXIT, "%s", Filename); > again: >- if (stat(Filename, &statbuf) < 0) { >+ if (stat(Filename, &statprev) < 0) { > warn("stat"); > fatal: unlink(Filename); > exit(ERROR_EXIT); > } >- mtime = statbuf.st_mtime; > > if ((!(editor = getenv("VISUAL"))) > && (!(editor = getenv("EDITOR"))) >@@ -409,7 +410,7 @@ > warn("stat"); > goto fatal; > } >- if (mtime == statbuf.st_mtime) { >+ if (0 == (memcmp(&statprev, &statbuf, sizeof(statprev))) ){ > warnx("no changes made to crontab"); > goto remove; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22612
: 11483