2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-02 07:15:27 +00:00

Rename ots -> omtim for improved readability.

This commit is contained in:
Todd C. Miller
2004-09-09 15:02:28 +00:00
parent 611b0ca14c
commit c932482733

View File

@@ -80,7 +80,7 @@ int sudo_edit(argc, argv)
struct tempfile { struct tempfile {
char *tfile; char *tfile;
char *ofile; char *ofile;
struct timespec ots; struct timespec omtim;
off_t osize; off_t osize;
} *tf; } *tf;
@@ -128,8 +128,8 @@ int sudo_edit(argc, argv)
memset(&sb, 0, sizeof(sb)); memset(&sb, 0, sizeof(sb));
} }
tf[i].ofile = *ap; tf[i].ofile = *ap;
tf[i].ots.tv_sec = mtim_getsec(sb); tf[i].omtim.tv_sec = mtim_getsec(sb);
tf[i].ots.tv_nsec = mtim_getnsec(sb); tf[i].omtim.tv_nsec = mtim_getnsec(sb);
tf[i].osize = sb.st_size; tf[i].osize = sb.st_size;
if ((cp = strrchr(tf[i].ofile, '/')) != NULL) if ((cp = strrchr(tf[i].ofile, '/')) != NULL)
cp++; cp++;
@@ -162,10 +162,10 @@ int sudo_edit(argc, argv)
* file's mtime. It is better than nothing and we only use the info * file's mtime. It is better than nothing and we only use the info
* to determine whether or not a file has been modified. * to determine whether or not a file has been modified.
*/ */
if (touch(tfd, NULL, &tf[i].ots) == -1) { if (touch(tfd, NULL, &tf[i].omtim) == -1) {
if (fstat(tfd, &sb) == 0) { if (fstat(tfd, &sb) == 0) {
tf[i].ots.tv_sec = mtim_getsec(sb); tf[i].omtim.tv_sec = mtim_getsec(sb);
tf[i].ots.tv_nsec = mtim_getnsec(sb); tf[i].omtim.tv_nsec = mtim_getnsec(sb);
} }
/* XXX - else error? */ /* XXX - else error? */
} }
@@ -273,8 +273,8 @@ int sudo_edit(argc, argv)
#ifdef HAVE_FSTAT #ifdef HAVE_FSTAT
if (fstat(tfd, &sb) == 0) { if (fstat(tfd, &sb) == 0) {
if (tf[i].osize == sb.st_size && if (tf[i].osize == sb.st_size &&
tf[i].ots.tv_sec == mtim_getsec(sb) && tf[i].omtim.tv_sec == mtim_getsec(sb) &&
tf[i].ots.tv_nsec == mtim_getnsec(sb)) { tf[i].omtim.tv_nsec == mtim_getnsec(sb)) {
/* /*
* If mtime and size match but the user spent no measurable * If mtime and size match but the user spent no measurable
* time in the editor we can't tell if the file was changed. * time in the editor we can't tell if the file was changed.