Whitespace fixes.

This commit is contained in:
pjd 2005-03-20 11:47:44 +00:00
parent c7d05e490c
commit 1fbe41652e
2 changed files with 6 additions and 7 deletions

View File

@ -146,7 +146,7 @@ print the process ID and the full argument list for each matching process.
This option can only be used with the This option can only be used with the
.Nm pgrep .Nm pgrep
command. command.
.It Fl n .It Fl n
Select only the newest (most recently started) of the matching processes. Select only the newest (most recently started) of the matching processes.
.It Fl o .It Fl o
Select only the oldest (least recently started) of the matching processes. Select only the oldest (least recently started) of the matching processes.

View File

@ -450,17 +450,16 @@ main(int argc, char **argv)
for (i = 0, kp = plist; i < nproc; i++, kp++) { for (i = 0, kp = plist; i < nproc; i++, kp++) {
if (!selected[i]) if (!selected[i])
continue; continue;
if (bestidx == -1) { if (bestidx == -1) {
/* The first entry of the list which matched. */ /* The first entry of the list which matched. */
; ;
} else if (timercmp(&kp->ki_start, &best_tval, >)) { } else if (timercmp(&kp->ki_start, &best_tval, >)) {
/* This entry is newer than previous "best". */ /* This entry is newer than previous "best". */
if (oldest) /* but we want the oldest */ if (oldest) /* but we want the oldest */
continue; continue;
} else { } else {
/* This entry is older than previous "best". */ /* This entry is older than previous "best". */
if (newest) /* but we want the newest */ if (newest) /* but we want the newest */
continue; continue;
} }
/* This entry is better than previous "best" entry. */ /* This entry is better than previous "best" entry. */
@ -637,11 +636,11 @@ takepid(const char *pidfile)
char *endp, line[BUFSIZ]; char *endp, line[BUFSIZ];
FILE *fh; FILE *fh;
long rval; long rval;
fh = fopen(pidfile, "r"); fh = fopen(pidfile, "r");
if (fh == NULL) if (fh == NULL)
err(STATUS_ERROR, "can't open pid file `%s'", pidfile); err(STATUS_ERROR, "can't open pid file `%s'", pidfile);
if (fgets(line, sizeof(line), fh) == NULL) { if (fgets(line, sizeof(line), fh) == NULL) {
if (feof(fh)) { if (feof(fh)) {
(void)fclose(fh); (void)fclose(fh);
@ -651,7 +650,7 @@ takepid(const char *pidfile)
err(STATUS_ERROR, "can't read from pid file `%s'", pidfile); err(STATUS_ERROR, "can't read from pid file `%s'", pidfile);
} }
(void)fclose(fh); (void)fclose(fh);
rval = strtol(line, &endp, 10); rval = strtol(line, &endp, 10);
if (*endp != '\0' && !isspace((unsigned char)*endp)) if (*endp != '\0' && !isspace((unsigned char)*endp))
errx(STATUS_ERROR, "invalid pid in file `%s'", pidfile); errx(STATUS_ERROR, "invalid pid in file `%s'", pidfile);