Author: araujo (ports committer)
Date: Sat Jul  4 17:38:56 2015
New Revision: 285143
URL: https://svnweb.freebsd.org/changeset/base/285143

Log:
  Remove unused variable flags reported by clang. The function zygote_clone()
  always receive the flags with value 0 and this flags is never checked on
  zygote_main().
  
  Differential Revision:        D2689
  Reviewed by:          rodrigc, oshogbo

Modified:
  head/sbin/casperd/casperd.c
  head/sbin/casperd/zygote.c
  head/sbin/casperd/zygote.h

Modified: head/sbin/casperd/casperd.c
==============================================================================
--- head/sbin/casperd/casperd.c Sat Jul  4 17:37:00 2015        (r285142)
+++ head/sbin/casperd/casperd.c Sat Jul  4 17:38:56 2015        (r285143)
@@ -253,7 +253,7 @@ casper_command(const char *cmd, const nv
                return (error);
        }
 
-       if (zygote_clone(service_external_execute, 0, &chanfd, &procfd) == -1) {
+       if (zygote_clone(service_external_execute, &chanfd, &procfd) == -1) {
                error = errno;
                close(execfd);
                return (error);

Modified: head/sbin/casperd/zygote.c
==============================================================================
--- head/sbin/casperd/zygote.c  Sat Jul  4 17:37:00 2015        (r285142)
+++ head/sbin/casperd/zygote.c  Sat Jul  4 17:38:56 2015        (r285143)
@@ -77,7 +77,7 @@ stdnull(void)
 }
 
 int
-zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
+zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp)
 {
        nvlist_t *nvl;
        int error;
@@ -90,7 +90,6 @@ zygote_clone(zygote_func_t *func, int fl
 
        nvl = nvlist_create(0);
        nvlist_add_number(nvl, "func", (uint64_t)(uintptr_t)func);
-       nvlist_add_number(nvl, "flags", (uint64_t)flags);
        nvl = nvlist_xfer(zygote_sock, nvl, 0);
        if (nvl == NULL)
                return (-1);
@@ -117,7 +116,7 @@ zygote_clone(zygote_func_t *func, int fl
 static void
 zygote_main(int sock)
 {
-       int error, fd, flags, procfd;
+       int error, fd, procfd;
        int chanfd[2];
        nvlist_t *nvlin, *nvlout;
        zygote_func_t *func;
@@ -144,7 +143,6 @@ zygote_main(int sock)
                }
                func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin,
                    "func");
-               flags = (int)nvlist_get_number(nvlin, "flags");
                nvlist_destroy(nvlin);
 
                /*

Modified: head/sbin/casperd/zygote.h
==============================================================================
--- head/sbin/casperd/zygote.h  Sat Jul  4 17:37:00 2015        (r285142)
+++ head/sbin/casperd/zygote.h  Sat Jul  4 17:38:56 2015        (r285143)
@@ -35,6 +35,6 @@
 typedef void zygote_func_t(int);
 
 int zygote_init(void);
-int zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp);
+int zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp);
 
 #endif /* !_ZYGOTE_H_ */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to