]> git.proxmox.com Git - mirror_frr.git/blobdiff - tools/start-stop-daemon.c
Merge pull request #6184 from kssoman/route
[mirror_frr.git] / tools / start-stop-daemon.c
index cc0315c1307de1c0166af7821c752bd56388f8eb..13118a2769c3efb619ea92d733dfa456fe78033d 100644 (file)
@@ -235,7 +235,7 @@ static const char *next_dirname(const char *s)
 {
        const char *cur;
 
-       cur = (const char *)s;
+       cur = s;
 
        if (*cur != '\0') {
                for (; *cur != '/'; ++cur)
@@ -255,7 +255,7 @@ static void add_namespace(const char *path)
        const char *nsdirname, *nsname, *cur;
        struct namespace *namespace;
 
-       cur = (const char *)path;
+       cur = path;
        nsdirname = nsname = "";
 
        while ((cur = next_dirname(cur))[0] != '\0') {
@@ -273,14 +273,14 @@ static void add_namespace(const char *path)
                badusage("invalid namepspace path");
 
        namespace = xmalloc(sizeof(*namespace));
-       namespace->path = (const char *)path;
+       namespace->path = path;
        namespace->nstype = nstype;
        LIST_INSERT_HEAD(&namespace_head, namespace, list);
 }
 #endif
 
 #ifdef HAVE_LXC
-static void set_namespaces()
+static void set_namespaces(void)
 {
        struct namespace *namespace;
        int fd;
@@ -294,7 +294,7 @@ static void set_namespaces()
        }
 }
 #else
-static void set_namespaces()
+static void set_namespaces(void)
 {
        if (!LIST_EMPTY(&namespace_head))
                fatal("LCX namespaces not supported");
@@ -401,7 +401,7 @@ static void parse_schedule_item(const char *string, struct schedule_item *item)
 
        if (!strcmp(string, "forever")) {
                item->type = sched_forever;
-       } else if (isdigit((int)string[0])) {
+       } else if (isdigit((unsigned char)string[0])) {
                item->type = sched_timeout;
                if (parse_integer(string, &item->value) != 0)
                        badusage("invalid timeout value in schedule");
@@ -1013,7 +1013,7 @@ int main(int argc, char **argv)
        if (background) { /* ok, we need to detach this process */
                int i, fd;
                if (quietmode < 0)
-                       printf("Detatching to start %s...", startas);
+                       printf("Detaching to start %s...", startas);
                i = fork();
                if (i < 0) {
                        fatal("Unable to fork.\n");
@@ -1030,7 +1030,9 @@ int main(int argc, char **argv)
                /* change tty */
                fd = open("/dev/tty", O_RDWR);
                if (fd >= 0) {
-                       ioctl(fd, TIOCNOTTY, 0);
+                       if (ioctl(fd, TIOCNOTTY, 0) < 0)
+                               printf("ioctl TIOCNOTTY failed: %s\n",
+                                      strerror(errno));
                        close(fd);
                }
                chdir("/");