summaryrefslogtreecommitdiff
path: root/stow.c
diff options
context:
space:
mode:
Diffstat (limited to 'stow.c')
-rw-r--r--stow.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/stow.c b/stow.c
index cf6366e..adfcf53 100644
--- a/stow.c
+++ b/stow.c
@@ -21,7 +21,9 @@
/* Stow mode for unionfs. */
#include <argp.h>
+#include <assert.h>
#include <error.h>
+#include <stdlib.h>
#include "ulfs.h"
#include "lib.h"
@@ -167,6 +169,15 @@ begin_using_notify_port (fs_notify_t port)
return ports_lookup_port (stow_port_bucket, port, stow_port_class);
}
+/* Called by MiG to translate ports into stow_notify_t when using the
+ protected payload feature. mutations.h arranges for this to happen
+ for the fs_notify interfaces. */
+stow_notify_t
+begin_using_notify_port_payload (unsigned long payload)
+{
+ return ports_lookup_payload (stow_port_bucket, payload, stow_port_class);
+}
+
/* Called by MiG after server routines have been run; this balances
begin_using_notify_port, and is arranged for the fs_notify
interfaces by mutations.h. */
@@ -271,14 +282,15 @@ stow_diradd (char *dir, int flags, struct patternlist *patternlist,
{
char *tmp;
- tmp = (char *) malloc (dir_len + 1);
+ tmp = (char *) malloc (dir_len + 2);
if (tmp == NULL)
return ENOMEM;
- strncpy (tmp, dir, dir_len);
+ strcpy (tmp, dir);
tmp[dir_len] = '/';
+ tmp[dir_len + 1] = 0;
dir = tmp;
}