=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/commands.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/top/commands.c 2004/05/09 22:14:15 1.14 --- src/usr.bin/top/commands.c 2004/06/27 00:48:22 1.15 *************** *** 1,4 **** ! /* $OpenBSD: commands.c,v 1.14 2004/05/09 22:14:15 deraadt Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: commands.c,v 1.15 2004/06/27 00:48:22 marc Exp $ */ /* * Top users/processes display for Unix *************** *** 156,162 **** #define ERRMAX 20 struct errs { /* structure for a system-call error */ ! int errno; /* value of errno (that is, the actual error) */ char *arg; /* argument that caused the error */ }; --- 156,162 ---- #define ERRMAX 20 struct errs { /* structure for a system-call error */ ! int err; /* value of errno (that is, the actual error) */ char *arg; /* argument that caused the error */ }; *************** *** 173,179 **** return(err_toomany); \ } else { \ errs[errcnt].arg = (p); \ ! errs[errcnt++].errno = (e); \ } #define STRMAX 80 --- 173,179 ---- return(err_toomany); \ } else { \ errs[errcnt].arg = (p); \ ! errs[errcnt++].err = (e); \ } #define STRMAX 80 *************** *** 205,211 **** /* loop thru the sorted list, building an error string */ while (cnt < errcnt) { errp = &(errs[cnt++]); ! if (errp->errno != currerr) { if (currerr != -1) { if (str_adderr(string, sizeof string, currerr) > sizeof string - 2) --- 205,211 ---- /* loop thru the sorted list, building an error string */ while (cnt < errcnt) { errp = &(errs[cnt++]); ! if (errp->err != currerr) { if (currerr != -1) { if (str_adderr(string, sizeof string, currerr) > sizeof string - 2) *************** *** 214,220 **** /* we know there's more */ (void) strlcat(string, "; ", sizeof string); } ! currerr = errp->errno; first = Yes; } if (str_addarg(string, sizeof string, errp->arg, first) >= --- 214,220 ---- /* we know there's more */ (void) strlcat(string, "; ", sizeof string); } ! currerr = errp->err; first = Yes; } if (str_addarg(string, sizeof string, errp->arg, first) >= *************** *** 278,284 **** const struct errs *p2 = (struct errs *) e2; int result; ! if ((result = p1->errno - p2->errno) == 0) return (strcmp(p1->arg, p2->arg)); return (result); } --- 278,284 ---- const struct errs *p2 = (struct errs *) e2; int result; ! if ((result = p1->err - p2->err) == 0) return (strcmp(p1->arg, p2->arg)); return (result); } *************** *** 304,310 **** printf("%d error%s:\n\n", errcnt, errcnt == 1 ? "" : "s"); while (cnt++ < errcnt) { printf("%5s: %s\n", errp->arg, ! errp->errno == 0 ? "Not a number" : strerror(errp->errno)); errp++; } } --- 304,310 ---- printf("%d error%s:\n\n", errcnt, errcnt == 1 ? "" : "s"); while (cnt++ < errcnt) { printf("%5s: %s\n", errp->arg, ! errp->err == 0 ? "Not a number" : strerror(errp->err)); errp++; } }