aboutsummaryrefslogtreecommitdiff
path: root/nis
diff options
context:
space:
mode:
Diffstat (limited to 'nis')
-rw-r--r--nis/nis_file.c18
-rw-r--r--nis/nis_free.c4
-rw-r--r--nis/rpcsvc/nislib.h4
3 files changed, 16 insertions, 10 deletions
diff --git a/nis/nis_file.c b/nis/nis_file.c
index 002e72e..ccff52f 100644
--- a/nis/nis_file.c
+++ b/nis/nis_file.c
@@ -23,6 +23,9 @@
#include <rpcsvc/nis.h>
#include <rpcsvc/nislib.h>
+
+static const char cold_start_file[] = "/var/nis/NIS_COLD_START";
+
directory_obj *
readColdStartFile (void)
{
@@ -30,17 +33,17 @@ readColdStartFile (void)
FILE *in;
directory_obj obj;
- in = fopen ("/var/nis/NIS_COLD_START", "rb");
+ in = fopen (cold_start_file, "rb");
if (in == NULL)
{
- fputs (_("Error: Could not open /var/nis/NIS_COLD_START!\n"), stdout);
+ printf (_("Error while opening %s for reading: %m"), cold_start_file);
return NULL;
}
memset (&obj, '\0', sizeof (obj));
xdrstdio_create (&xdrs, in, XDR_DECODE);
if (!xdr_directory_obj (&xdrs, &obj))
{
- fputs (("Error while reading /var/nis/NIS_COLD_START!\n"), stdout);
+ printf (_("Error while reading %s: %m"), cold_start_file);
return NULL;
}
@@ -53,16 +56,19 @@ writeColdStartFile (const directory_obj *obj)
XDR xdrs;
FILE *out;
- out = fopen ("/var/nis/NIS_COLD_START", "wb");
+ out = fopen (cold_start_file, "wb");
if (out == NULL)
- return FALSE;
+ {
+ printf (_("Error while opening %s for writing: %m"), cold_start_file);
+ return FALSE;
+ }
xdrstdio_create (&xdrs, out, XDR_ENCODE);
/* XXX The following cast is bad! Shouldn't the XDR functions take
pointers to const objects? */
if (!xdr_directory_obj (&xdrs, (directory_obj *) obj))
{
- fputs (_("Error while reading /var/nis/NIS_COLD_START!\n"), stdout);
+ printf (_("Error while writing %s: %m"), cold_start_file);
return FALSE;
}
diff --git a/nis/nis_free.c b/nis/nis_free.c
index 35b7331..60399c1 100644
--- a/nis/nis_free.c
+++ b/nis/nis_free.c
@@ -67,7 +67,7 @@ nis_free_request (ib_request *ibreq)
}
void
-nis_free_endpoints (endpoint *ep, int len)
+nis_free_endpoints (endpoint *ep, unsigned int len)
{
int i;
@@ -95,7 +95,7 @@ nis_free_endpoints (endpoint *ep, int len)
}
void
-nis_free_servers (nis_server *obj, int len)
+nis_free_servers (nis_server *obj, unsigned int len)
{
int i;
diff --git a/nis/rpcsvc/nislib.h b/nis/rpcsvc/nislib.h
index 2ad38ef..b01270b 100644
--- a/nis/rpcsvc/nislib.h
+++ b/nis/rpcsvc/nislib.h
@@ -144,8 +144,8 @@ extern void nis_freeresult __P ((nis_result *));
/* (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */
extern void nis_free_attr __P ((nis_attr *));
extern void nis_free_request __P ((ib_request *));
-extern void nis_free_endpoints __P ((endpoint *, int));
-extern void nis_free_servers __P ((nis_server *, int));
+extern void nis_free_endpoints __P ((endpoint *, unsigned int));
+extern void nis_free_servers __P ((nis_server *, unsigned int));
extern void nis_free_directory __P ((directory_obj *));
extern void nis_free_group __P ((group_obj *));
extern void nis_free_table __P ((table_obj *));