=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/mksubr,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/kdump/mksubr 2012/07/21 07:16:03 1.13 +++ src/usr.bin/kdump/mksubr 2012/12/25 09:35:51 1.14 @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: mksubr,v 1.13 2012/07/21 07:16:03 matthew Exp $ +# $OpenBSD: mksubr,v 1.14 2012/12/25 09:35:51 guenther Exp $ # # Copyright (c) 2006 David Kirchner # @@ -251,6 +251,7 @@ #include #include #include +#include #include #include #include @@ -415,10 +416,11 @@ void flagsandmodename (int flags, int mode) { flagsname (flags); - (void)putchar(','); if ((flags & O_CREAT) == O_CREAT) { + (void)putchar(','); modename (mode); - } else { + } else if (!fancy) { + (void)putchar(','); if (decimal) { (void)printf("%ld", (long)mode); } else { @@ -468,8 +470,9 @@ #auto_or_type "nfssvcname" "NFSSVC_[A-Z]+[[:space:]]+0x[0-9]+" "nfsserver/nfs.h" # auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" +auto_switch_type "pathconfname" "_PC_[_A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" -#auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" +auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" #auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" @@ -480,6 +483,7 @@ #auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h" #auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" #auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +auto_switch_type "rusagewho" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h" auto_orz_type "sigactionflagname" "SA_[A-Z]+[[:space:]]+0x[0-9]+" "sys/signal.h" auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_switch_type "sigill_name" "ILL_[A-Z]+[[:space:]]+[0-9]+" "sys/siginfo.h" @@ -525,8 +529,8 @@ default: /* Should not reach */ (void)printf("", (long)cmd); } - (void)putchar(','); - if (cmd == F_GETFD || cmd == F_SETFD) { + if (cmd == F_SETFD) { + (void)putchar(','); if (arg == FD_CLOEXEC) (void)printf("FD_CLOEXEC"); else if (arg == 0) @@ -537,9 +541,12 @@ else (void)printf("%#lx", (long)arg); } + } else if (cmd == F_SETFL) { + (void)putchar(','); flagsname(arg); - } else { + } else if (!fancy || (cmd != F_GETFD && cmd != F_GETFL)) { + (void)putchar(','); if (decimal) (void)printf("%ld", (long)arg); else