Diff for /qemu/qemu-nbd.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2018/04/24 16:50:38 version 1.1.1.2, 2018/04/24 17:20:47
Line 13 Line 13
  *  GNU General Public License for more details.   *  GNU General Public License for more details.
  *   *
  *  You should have received a copy of the GNU General Public License   *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software   *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA  
  */   */
   
 #include <qemu-common.h>  #include <qemu-common.h>
Line 192  int main(int argc, char **argv) Line 191  int main(int argc, char **argv)
     char sockpath[128];      char sockpath[128];
     const char *sopt = "hVb:o:p:rsnP:c:dvk:e:t";      const char *sopt = "hVb:o:p:rsnP:c:dvk:e:t";
     struct option lopt[] = {      struct option lopt[] = {
         { "help", 0, 0, 'h' },          { "help", 0, NULL, 'h' },
         { "version", 0, 0, 'V' },          { "version", 0, NULL, 'V' },
         { "bind", 1, 0, 'b' },          { "bind", 1, NULL, 'b' },
         { "port", 1, 0, 'p' },          { "port", 1, NULL, 'p' },
         { "socket", 1, 0, 'k' },          { "socket", 1, NULL, 'k' },
         { "offset", 1, 0, 'o' },          { "offset", 1, NULL, 'o' },
         { "read-only", 0, 0, 'r' },          { "read-only", 0, NULL, 'r' },
         { "partition", 1, 0, 'P' },          { "partition", 1, NULL, 'P' },
         { "connect", 1, 0, 'c' },          { "connect", 1, NULL, 'c' },
         { "disconnect", 0, 0, 'd' },          { "disconnect", 0, NULL, 'd' },
         { "snapshot", 0, 0, 's' },          { "snapshot", 0, NULL, 's' },
         { "nocache", 0, 0, 'n' },          { "nocache", 0, NULL, 'n' },
         { "shared", 1, 0, 'e' },          { "shared", 1, NULL, 'e' },
         { "persistent", 0, 0, 't' },          { "persistent", 0, NULL, 't' },
         { "verbose", 0, 0, 'v' },          { "verbose", 0, NULL, 'v' },
         { NULL, 0, 0, 0 }          { NULL, 0, NULL, 0 }
     };      };
     int ch;      int ch;
     int opt_ind = 0;      int opt_ind = 0;
Line 345  int main(int argc, char **argv) Line 344  int main(int argc, char **argv)
         pid_t pid;          pid_t pid;
         int sock;          int sock;
   
         if (!verbose)          if (!verbose) {
             daemon(0, 0);       /* detach client and server */              /* detach client and server */
               if (daemon(0, 0) == -1) {
                   errx(errno, "Failed to daemonize");
               }
           }
   
         if (socket == NULL) {          if (socket == NULL) {
             sprintf(sockpath, SOCKET_PATH, basename(device));              sprintf(sockpath, SOCKET_PATH, basename(device));

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


unix.superglobalmegacorp.com