* NSM for Linux.
*/
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <errno.h>
#include <arpa/inet.h>
#include "misc.h"
#include "statd.h"
sprintf(path, "%s/%s", SM_DIR, mon_name);
if ((fd = open(path, O_WRONLY|O_SYNC|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
/* Didn't fly. We won't monitor. */
- note(N_ERROR, "creat(%s) failed: %m", path);
+ note(N_ERROR, "creat(%s) failed: %s", path, strerror (errno));
nlist_free(NULL, clnt);
free(path);
goto failure;
clnt = NL_NEXT(clnt);
}
+#ifdef RESTRICTED_STATD
failure:
+#endif
note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s",
my_name, mon_name);
return (&result);
dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no "
"SM_MON requests from it.", my_name);
}
+#ifdef RESTRICTED_STATD
failure:
+#endif
return (&result);
}