Add error reporting to net_conf_delshare().
authorMichael Adam <obnox@samba.org>
Tue, 25 Dec 2007 01:42:33 +0000 (02:42 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 25 Dec 2007 01:42:33 +0000 (02:42 +0100)
Michael

source/utils/net_conf.c

index 38c14d779f10f36af56b435dc52ec6f93036ab02..54875c49a3edd7c26d02ea31ff9e6d289a3e04bf 100644 (file)
@@ -792,6 +792,7 @@ int net_conf_delshare(int argc, const char **argv)
 {
        int ret = -1;
        const char *sharename = NULL;
+       WERROR werr = WERR_OK;
 
        if (argc != 1) {
                net_conf_delshare_usage(argc, argv);
@@ -799,9 +800,14 @@ int net_conf_delshare(int argc, const char **argv)
        }
        sharename = argv[0];
 
-       if (W_ERROR_IS_OK(libnet_smbconf_delshare(sharename))) {
-               ret = 0;
+       werr = libnet_smbconf_delshare(sharename);
+       if (!W_ERROR_IS_OK(werr)) {
+               d_fprintf(stderr, "Error deleting share %s: %s\n",
+                         sharename, dos_errstr(werr));
+               goto done;
        }
+
+       ret = 0;
 done:
        return ret;
 }