diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-13 15:23:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-09-13 15:23:33 +0000 |
commit | b5b0c2b8eb01cd0f408f4a3b356f20a9679a7031 (patch) | |
tree | 6f9270dd7997aab36147226cb405c9747235a635 /usr.bin | |
parent | 7b12d8486bc1dda8d41d759c89930029911de4af (diff) |
Fix warnings caused by user_from_uid() and group_from_gid() now
returning const char *.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/fstat/fstat.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/sftp-common.c | 4 | ||||
-rw-r--r-- | usr.bin/systat/pigs.c | 4 | ||||
-rw-r--r-- | usr.bin/top/machine.c | 4 | ||||
-rw-r--r-- | usr.bin/top/machine.h | 4 | ||||
-rw-r--r-- | usr.bin/top/top.c | 4 | ||||
-rw-r--r-- | usr.bin/top/top.h | 4 | ||||
-rw-r--r-- | usr.bin/top/username.c | 4 | ||||
-rw-r--r-- | usr.bin/top/utils.c | 4 | ||||
-rw-r--r-- | usr.bin/top/utils.h | 4 |
10 files changed, 20 insertions, 20 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index 90e8f4fc5ee..783fda718d5 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fstat.c,v 1.93 2018/04/10 11:09:14 sthen Exp $ */ +/* $OpenBSD: fstat.c,v 1.94 2018/09/13 15:23:32 millert Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -331,7 +331,7 @@ fstat_header(void) putchar('\n'); } -char *Uname, *Comm; +const char *Uname, *Comm; uid_t *procuid; pid_t Pid; diff --git a/usr.bin/ssh/sftp-common.c b/usr.bin/ssh/sftp-common.c index c62940441cc..ba8efbfde48 100644 --- a/usr.bin/ssh/sftp-common.c +++ b/usr.bin/ssh/sftp-common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-common.c,v 1.30 2017/06/10 06:36:46 djm Exp $ */ +/* $OpenBSD: sftp-common.c,v 1.31 2018/09/13 15:23:32 millert Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Damien Miller. All rights reserved. @@ -211,7 +211,7 @@ ls_file(const char *name, const struct stat *st, int remote, int si_units) { int ulen, glen, sz = 0; struct tm *ltime = localtime(&st->st_mtime); - char *user, *group; + const char *user, *group; char buf[1024], lc[8], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char sbuf[FMT_SCALED_STRSIZE]; time_t now; diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index f9af1b0e111..71144ba6dc2 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pigs.c,v 1.30 2015/09/12 15:59:36 deraadt Exp $ */ +/* $OpenBSD: pigs.c,v 1.31 2018/09/13 15:23:32 millert Exp $ */ /* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */ /*- @@ -255,7 +255,7 @@ showpigs(int k) { struct kinfo_proc *kp; double value; - char *uname, *pname; + const char *uname, *pname; if (procbase == NULL) return; diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 4643778a15c..2926ec2133b 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.90 2018/05/14 12:31:21 mpi Exp $ */ +/* $OpenBSD: machine.c,v 1.91 2018/09/13 15:23:32 millert Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com> @@ -545,7 +545,7 @@ format_comm(struct kinfo_proc *kp) } char * -format_next_process(caddr_t hndl, char *(*get_userid)(uid_t), pid_t *pid, +format_next_process(caddr_t hndl, const char *(*get_userid)(uid_t), pid_t *pid, int show_threads) { char *p_wait; diff --git a/usr.bin/top/machine.h b/usr.bin/top/machine.h index eeb10deeee5..4c7c62b78dc 100644 --- a/usr.bin/top/machine.h +++ b/usr.bin/top/machine.h @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.h,v 1.20 2015/05/06 07:53:29 mpi Exp $ */ +/* $OpenBSD: machine.h,v 1.21 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -89,7 +89,7 @@ extern void get_system_info(struct system_info *); extern caddr_t get_process_info(struct system_info *, struct process_select *, int (*) (const void *, const void *)); -extern char *format_next_process(caddr_t, char *(*)(uid_t), pid_t *, int); +extern char *format_next_process(caddr_t, const char *(*)(uid_t), pid_t *, int); extern uid_t proc_owner(pid_t); extern struct kinfo_proc *getprocs(int, int, int *); diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index d3ed70e65f1..178696ba792 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.90 2018/07/29 13:34:26 deraadt Exp $ */ +/* $OpenBSD: top.c,v 1.91 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) { char *uname_field = "USERNAME", *header_text, *env_top; - char *(*get_userid)(uid_t) = username; + const char *(*get_userid)(uid_t) = username; char **preset_argv = NULL, **av = argv; int preset_argc = 0, ac = argc, active_procs, i; sigset_t mask, oldmask; diff --git a/usr.bin/top/top.h b/usr.bin/top/top.h index 16dfb7ae6ab..e54474f4cdb 100644 --- a/usr.bin/top/top.h +++ b/usr.bin/top/top.h @@ -1,4 +1,4 @@ -/* $OpenBSD: top.h,v 1.15 2013/09/21 14:15:19 espie Exp $ */ +/* $OpenBSD: top.h,v 1.16 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -78,5 +78,5 @@ extern char *renice_procs(char *); extern void quit(int); /* username.c */ -extern char *username(uid_t); +extern const char *username(uid_t); extern uid_t userid(char *); diff --git a/usr.bin/top/username.c b/usr.bin/top/username.c index b53e1c1a0b9..21d8d396efa 100644 --- a/usr.bin/top/username.c +++ b/usr.bin/top/username.c @@ -1,4 +1,4 @@ -/* $OpenBSD: username.c,v 1.17 2015/10/26 13:56:18 tedu Exp $ */ +/* $OpenBSD: username.c,v 1.18 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -41,7 +41,7 @@ #include "top.h" #include "utils.h" -char * +const char * username(uid_t uid) { return user_from_uid(uid, 0); diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c index cb21df164b5..9e7f9cce41b 100644 --- a/usr.bin/top/utils.c +++ b/usr.bin/top/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.26 2017/03/15 04:24:14 deraadt Exp $ */ +/* $OpenBSD: utils.c,v 1.27 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -88,7 +88,7 @@ itoa(int val) * format_uid(uid) - like itoa, except for uid_t and the number is right * justified in a 6 character field to match uname_field in top.c. */ -char * +const char * format_uid(uid_t uid) { static char buffer[16]; /* result is built here */ diff --git a/usr.bin/top/utils.h b/usr.bin/top/utils.h index e38e4b2f593..034d2f62c60 100644 --- a/usr.bin/top/utils.h +++ b/usr.bin/top/utils.h @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.h,v 1.8 2005/06/08 22:36:43 millert Exp $ */ +/* $OpenBSD: utils.h,v 1.9 2018/09/13 15:23:32 millert Exp $ */ /* * Top users/processes display for Unix @@ -32,7 +32,7 @@ int atoiwi(char *); char *itoa(int); -char *format_uid(uid_t); +const char *format_uid(uid_t); int digits(int); int string_index(char *, char **); char **argparse(char *, int *); |