summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstore/ChangeLog13
-rw-r--r--libstore/argp.c28
-rw-r--r--libstore/copy.c2
-rw-r--r--libstore/enc.c6
-rw-r--r--libstore/encode.c3
-rw-r--r--libstore/zero.c1
6 files changed, 35 insertions, 18 deletions
diff --git a/libstore/ChangeLog b/libstore/ChangeLog
index 4528a079..b310529c 100644
--- a/libstore/ChangeLog
+++ b/libstore/ChangeLog
@@ -1,3 +1,16 @@
+1999-07-11 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * argp.c (store_parsed_open): Add more braces to clarify if-else
+ structure.
+
+ * encode.c: Include <sys/mman.h>
+ * zero.c: Likewise.
+
+ * encode.c (store_encode): Repair syntax.
+ * copy.c (copy_read): Likewise.
+
+ * enc.c (store_enc_dealloc): Cast first arg of munmap correctly.
+
1999-07-10 Roland McGrath <roland@baalperazim.frob.com>
* rdwr.c: Add #include <sys/mman.h> for munmap decl.
diff --git a/libstore/argp.c b/libstore/argp.c
index b7636b56..97640e19 100644
--- a/libstore/argp.c
+++ b/libstore/argp.c
@@ -1,6 +1,6 @@
/* Store argument parsing
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -171,18 +171,20 @@ store_parsed_open (const struct store_parsed *parsed, int flags,
{
const struct store_class *type = parsed->type;
if (type->open)
- if (parsed->name_prefix)
- /* If there's a name prefix, we prefix any names we open with that
- and a colon. */
- {
- char pfxed_name[pfx_len + 1 + strlen (name) + 1];
- stpcpy (stpcpy (stpcpy (pfxed_name, parsed->name_prefix),
- ":"),
- name);
- return (*type->open) (pfxed_name, flags, parsed->classes, store);
- }
- else
- return (*type->open) (name, flags, parsed->classes, store);
+ {
+ if (parsed->name_prefix)
+ /* If there's a name prefix, we prefix any names we open with that
+ and a colon. */
+ {
+ char pfxed_name[pfx_len + 1 + strlen (name) + 1];
+ stpcpy (stpcpy (stpcpy (pfxed_name, parsed->name_prefix),
+ ":"),
+ name);
+ return (*type->open) (pfxed_name, flags, parsed->classes, store);
+ }
+ else
+ return (*type->open) (name, flags, parsed->classes, store);
+ }
else
return EOPNOTSUPP;
}
diff --git a/libstore/copy.c b/libstore/copy.c
index 0c1834fa..3f838e5c 100644
--- a/libstore/copy.c
+++ b/libstore/copy.c
@@ -35,7 +35,7 @@ copy_read (struct store *store,
/* Have to allocate memory for the return value. */
{
*buf = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
- if (*buf == (void *)-1))
+ if (*buf == (void *)-1)
return errno;
}
diff --git a/libstore/enc.c b/libstore/enc.c
index 65104cf0..d5002a0e 100644
--- a/libstore/enc.c
+++ b/libstore/enc.c
@@ -61,15 +61,15 @@ store_enc_dealloc (struct store_enc *enc)
}
if (enc->ports != enc->init_ports)
- munmap (enc->ports, enc->num_ports * sizeof (*enc->ports));
+ munmap ((caddr_t) enc->ports, enc->num_ports * sizeof (*enc->ports));
}
if (enc->ints && enc->num_ints > 0 && enc->ints != enc->init_ints)
- munmap (enc->ints, enc->num_ints * sizeof (*enc->ints));
+ munmap ((caddr_t) enc->ints, enc->num_ints * sizeof (*enc->ints));
if (enc->offsets && enc->num_offsets > 0
&& enc->offsets != enc->init_offsets)
- munmap (enc->offsets, enc->num_offsets * sizeof (*enc->offsets));
+ munmap ((caddr_t) enc->offsets, enc->num_offsets * sizeof (*enc->offsets));
if (enc->data && enc->data_len > 0 && enc->data != enc->init_data)
munmap (enc->data, enc->data_len);
diff --git a/libstore/encode.c b/libstore/encode.c
index 834a0d16..48c5d26a 100644
--- a/libstore/encode.c
+++ b/libstore/encode.c
@@ -19,6 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
#include <string.h>
+#include <sys/mman.h>
#include "store.h"
@@ -130,7 +131,7 @@ store_encode (const struct store *store, struct store_enc *enc)
if (buf != (void *) -1)
enc->data = buf;
}
- err = errno
+ err = errno;
if (! err)
err = (*class->encode) (store, enc);
diff --git a/libstore/zero.c b/libstore/zero.c
index 33e34142..55f84a2c 100644
--- a/libstore/zero.c
+++ b/libstore/zero.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
+#include <sys/mman.h>
#include "store.h"