mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
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.
This commit is contained in:
parent
44aff4cd6d
commit
593453115b
@ -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;
|
||||
|
12
udev/udev.h
12
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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user