From 593453115b777368252ca4231537ad2a9e6d8ffb Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Tue, 2 Sep 2008 23:19:36 +0200 Subject: [PATCH] remove deprecated envp[] in main() envp is not standardized, and may become invalid when environment variables are modified. Since udev never actually uses it, we can simply remove it. Should anyone miss it in future, they can use the standardized environ variable - like udev_rules.c does already. --- udev/test-udev.c | 2 +- udev/udev.h | 12 ++++++------ udev/udevadm.c | 10 +++++----- udev/udevcontrol.c | 2 +- udev/udevd.c | 2 +- udev/udevinfo.c | 2 +- udev/udevmonitor.c | 2 +- udev/udevsettle.c | 2 +- udev/udevtest.c | 2 +- udev/udevtrigger.c | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/udev/test-udev.c b/udev/test-udev.c index 4d5881de..07628f74 100644 --- a/udev/test-udev.c +++ b/udev/test-udev.c @@ -60,7 +60,7 @@ static void asmlinkage sig_handler(int signum) } } -int main(int argc, char *argv[], char *envp[]) +int main(int argc, char *argv[]) { struct sysfs_device *dev; struct udevice *udev; diff --git a/udev/udev.h b/udev/udev.h index 94456749..da863650 100644 --- a/udev/udev.h +++ b/udev/udev.h @@ -168,11 +168,11 @@ extern int unlink_secure(const char *filename); extern size_t buf_get_line(const char *buf, size_t buflen, size_t cur); /* udev commands */ -extern int udevmonitor(int argc, char *argv[], char *envp[]); -extern int udevinfo(int argc, char *argv[], char *envp[]); -extern int udevcontrol(int argc, char *argv[], char *envp[]); -extern int udevtrigger(int argc, char *argv[], char *envp[]); -extern int udevsettle(int argc, char *argv[], char *envp[]); -extern int udevtest(int argc, char *argv[], char *envp[]); +extern int udevmonitor(int argc, char *argv[]); +extern int udevinfo(int argc, char *argv[]); +extern int udevcontrol(int argc, char *argv[]); +extern int udevtrigger(int argc, char *argv[]); +extern int udevsettle(int argc, char *argv[]); +extern int udevtest(int argc, char *argv[]); #endif diff --git a/udev/udevadm.c b/udev/udevadm.c index 7adb7c57..cb356c52 100644 --- a/udev/udevadm.c +++ b/udev/udevadm.c @@ -49,20 +49,20 @@ void log_message(int priority, const char *format, ...) struct command { const char *name; - int (*cmd)(int argc, char *argv[], char *envp[]); + int (*cmd)(int argc, char *argv[]); const char *help; int debug; }; static const struct command cmds[]; -static int version(int argc, char *argv[], char *envp[]) +static int version(int argc, char *argv[]) { printf("%s\n", VERSION); return 0; } -static int help(int argc, char *argv[], char *envp[]) +static int help(int argc, char *argv[]) { const struct command *cmd; @@ -118,7 +118,7 @@ static const struct command cmds[] = { {} }; -int main(int argc, char *argv[], char *envp[]) +int main(int argc, char *argv[]) { const char *command; const char *pos; @@ -157,7 +157,7 @@ int main(int argc, char *argv[], char *envp[]) for (cmd = cmds; cmd->name != NULL; cmd++) { if (strcmp(cmd->name, command) == 0) { debug = cmd->debug; - rc = cmd->cmd(argc, argv, envp); + rc = cmd->cmd(argc, argv); goto out; } } diff --git a/udev/udevcontrol.c b/udev/udevcontrol.c index a02bfc4d..f4830d84 100644 --- a/udev/udevcontrol.c +++ b/udev/udevcontrol.c @@ -36,7 +36,7 @@ static int sock = -1; static int udev_log = 0; -int udevcontrol(int argc, char *argv[], char *envp[]) +int udevcontrol(int argc, char *argv[]) { static struct udevd_ctrl_msg ctrl_msg; struct sockaddr_un saddr; diff --git a/udev/udevd.c b/udev/udevd.c index 654118e5..49159494 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -953,7 +953,7 @@ static void export_initial_seqnum(void) } } -int main(int argc, char *argv[], char *envp[]) +int main(int argc, char *argv[]) { int retval; int fd; diff --git a/udev/udevinfo.c b/udev/udevinfo.c index 714a69c3..738ffc67 100644 --- a/udev/udevinfo.c +++ b/udev/udevinfo.c @@ -234,7 +234,7 @@ static int stat_device(const char *name, int export, const char *prefix) return 0; } -int udevinfo(int argc, char *argv[], char *envp[]) +int udevinfo(int argc, char *argv[]) { int option; struct udevice *udev = NULL; diff --git a/udev/udevmonitor.c b/udev/udevmonitor.c index 2430dd39..3b65bcae 100644 --- a/udev/udevmonitor.c +++ b/udev/udevmonitor.c @@ -123,7 +123,7 @@ static const char *search_key(const char *searchkey, const char *buf, size_t buf return NULL; } -int udevmonitor(int argc, char *argv[], char *envp[]) +int udevmonitor(int argc, char *argv[]) { struct sigaction act; int option; diff --git a/udev/udevsettle.c b/udev/udevsettle.c index f00a38b4..11277f5a 100644 --- a/udev/udevsettle.c +++ b/udev/udevsettle.c @@ -67,7 +67,7 @@ static void print_queue(const char *dir) printf("\n\n"); } -int udevsettle(int argc, char *argv[], char *envp[]) +int udevsettle(int argc, char *argv[]) { char queuename[PATH_SIZE]; char filename[PATH_SIZE]; diff --git a/udev/udevtest.c b/udev/udevtest.c index 7c6e3f91..63603aad 100644 --- a/udev/udevtest.c +++ b/udev/udevtest.c @@ -71,7 +71,7 @@ out: return rc; } -int udevtest(int argc, char *argv[], char *envp[]) +int udevtest(int argc, char *argv[]) { int force = 0; const char *action = "add"; diff --git a/udev/udevtrigger.c b/udev/udevtrigger.c index 3dd9109b..4a8f62ab 100644 --- a/udev/udevtrigger.c +++ b/udev/udevtrigger.c @@ -562,7 +562,7 @@ static void scan_failed(void) } } -int udevtrigger(int argc, char *argv[], char *envp[]) +int udevtrigger(int argc, char *argv[]) { int failed = 0; const char *sockpath = NULL; -- 2.39.5