CVSROOT:        /sources/hurdextras
Module name:    mboxfs
Changes by:     Samuel Thibault <sthibaul>      23/10/03 15:28:17

Modified files:
        .              : backend.h fs.c mboxfs.c netfs.c 

Log message:
        Fix build

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mboxfs/backend.h?cvsroot=hurdextras&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/mboxfs/fs.c?cvsroot=hurdextras&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/mboxfs/mboxfs.c?cvsroot=hurdextras&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/mboxfs/netfs.c?cvsroot=hurdextras&r1=1.3&r2=1.4

Patches:
Index: backend.h
===================================================================
RCS file: /sources/hurdextras/mboxfs/backend.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- backend.h   12 Apr 2006 11:31:42 -0000      1.2
+++ backend.h   3 Oct 2023 19:28:17 -0000       1.3
@@ -63,7 +63,7 @@
   error_t (*get_args)(char **argz, unsigned *argz_len);
 
   /* Set options (see netfs_set_options()). */
-  error_t (*set_options)(char *argz, size_t argz_len);
+  error_t (*set_options)(const char *argz, size_t argz_len);
 
 
   /* 

Index: fs.c
===================================================================
RCS file: /sources/hurdextras/mboxfs/fs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- fs.c        12 Apr 2006 11:31:42 -0000      1.2
+++ fs.c        3 Oct 2023 19:28:17 -0000       1.3
@@ -461,9 +461,10 @@
     if (strlen (path) + strlen (n->nn->name) + 1 + 1 > len)
     {
       char* new;
+      size_t offset = ptr - path;
       len *= 2;
       new = realloc (path, len);
-      ptr = new + (ptr - path);
+      ptr = new + offset;
       path = new;
     }
     REVERSE_COPY (ptr, n->nn->name);
@@ -507,9 +508,10 @@
     if (strlen (path) + 3 + 1 > len)
     {
       char* new;
+      size_t offset = ptr - path;
       len *= 2;
       new = realloc (path, len);
-      ptr = new + (ptr - path);
+      ptr = new + offset;
       path = new;
     }
     strncpy (ptr, "../", 3);

Index: mboxfs.c
===================================================================
RCS file: /sources/hurdextras/mboxfs/mboxfs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- mboxfs.c    1 Aug 2020 16:24:32 -0000       1.6
+++ mboxfs.c    3 Oct 2023 19:28:17 -0000       1.7
@@ -141,7 +141,7 @@
  * sense when mboxfs is already running).
  */
 error_t
-mboxfs_set_options (char *argz, size_t argz_len)
+mboxfs_set_options (const char *argz, size_t argz_len)
 {
   /* FIXME:
    * Changing the show_headers flag implies an st_size modification, which
@@ -500,6 +500,7 @@
   if (mbox_open_mailbox (&main_context) != 0)
     error (1, 0, "Provided mailbox could not be parsed (%s, type %s).",
           main_context.path, mboxfs_options.force_mmdf ? "MMDF" : "MBOX");
+  return NULL;
 }
 
 error_t

Index: netfs.c
===================================================================
RCS file: /sources/hurdextras/mboxfs/netfs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- netfs.c     10 Feb 2013 10:26:55 -0000      1.3
+++ netfs.c     3 Oct 2023 19:28:17 -0000       1.4
@@ -64,7 +64,7 @@
    This call should unlock DIR no matter what.)  */
 error_t
 netfs_attempt_lookup (struct iouser *user, struct node *dir, 
-                             char *name, struct node **np)
+                             const char *name, struct node **np)
 {
   error_t err = 0;
 
@@ -148,7 +148,7 @@
    return.  */
 error_t
 netfs_attempt_write (struct iouser *cred, struct node *np,
-                            off_t offset, size_t *len, void *data)
+                            off_t offset, size_t *len, const void *data)
 {
   return EROFS;
 }
@@ -357,7 +357,7 @@
    CRED. NP is locked.  */
 error_t
 netfs_set_translator (struct iouser *cred, struct node *np,
-    char *argz, size_t argzlen)
+    const char *argz, size_t argzlen)
 {
   return EROFS;
 }
@@ -415,7 +415,7 @@
    (user CRED) into a symlink with target NAME.  */
 error_t
 netfs_attempt_mksymlink (struct iouser *cred, struct node *np,
-                                char *name)
+                                const char *name)
 {
   return EPERM;
 }
@@ -444,7 +444,7 @@
    locked) for USER.  */
 error_t
 netfs_attempt_unlink (struct iouser *user, struct node *dir,
-                             char *name)
+                             const char *name)
 {
   return EROFS;
 }
@@ -454,8 +454,8 @@
    are locked.  */
 error_t
 netfs_attempt_rename (struct iouser *user, struct node *fromdir,
-                             char *fromname, struct node *todir, 
-                             char *toname, int excl)
+                             const char *fromname, struct node *todir, 
+                             const char *toname, int excl)
 {
   return EROFS;
 }
@@ -465,7 +465,7 @@
    MODE. */
 error_t
 netfs_attempt_mkdir (struct iouser *user, struct node *dir,
-                            char *name, mode_t mode)
+                            const char *name, mode_t mode)
 {
   return EROFS;
 }
@@ -475,7 +475,7 @@
    named NAME in DIR (which is locked) for USER.  */
 error_t
 netfs_attempt_rmdir (struct iouser *user, 
-                            struct node *dir, char *name)
+                            struct node *dir, const char *name)
 {
   return EROFS;
 }
@@ -487,7 +487,7 @@
    NAME is already found in DIR.  */
 error_t
 netfs_attempt_link (struct iouser *user, struct node *dir,
-                           struct node *file, char *name, int excl)
+                           struct node *file, const char *name, int excl)
 {
   return EROFS;
 }
@@ -510,7 +510,7 @@
    locked on success; no matter what, unlock DIR before returning.  */
 error_t
 netfs_attempt_create_file (struct iouser *user, struct node *dir,
-                                  char *name, mode_t mode, struct node **np)
+                                  const char *name, mode_t mode, struct node 
**np)
 {
   *np = NULL;
   pthread_mutex_unlock (&dir->lock);
@@ -533,7 +533,7 @@
    returned if some option is unrecognized.  The default definition of this
    routine will parse them using NETFS_RUNTIME_ARGP. */
 error_t
-netfs_set_options (char *argz, size_t argz_len)
+netfs_set_options (const char *argz, size_t argz_len)
 {
   error_t err = EINVAL;
   if (backend.set_options)

_______________________________________________
Hurdextras-commit mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/hurdextras-commit

Reply via email to