-static int hotplug_call_mount(const char *action, const char *device)
-{
- pid_t pid;
- int err = 0;
-
- pid = fork();
- if (!pid) {
- char * const argv[] = { "hotplug-call", "mount", NULL };
-
- setenv("ACTION", action, 1);
- setenv("DEVICE", device, 1);
-
- execv("/sbin/hotplug-call", argv);
- exit(-1);
- } else if (pid > 0) {
- int status;
-
- pid = waitpid(pid, &status, 0);
- if (pid <= 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
- err = -ENOEXEC;
- ULOG_ERR("hotplug-call call failed\n");
- }
- } else {
- err = -errno;
- }
-
- return err;
-}
-