summaryrefslogtreecommitdiff
path: root/source3/smbd/notify_hash.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-19 08:37:32 +0000
committerJeremy Allison <jra@samba.org>2001-10-19 08:37:32 +0000
commit4bb9cebf84e1addc135c18b1227e7c00e7c03163 (patch)
treef110d0b45b65344f9fe9aa2ecd2da8d13c214e56 /source3/smbd/notify_hash.c
parente3e9c52b7a5d653d1a6ec4a741c8335829fd6a87 (diff)
downloadsamba-4bb9cebf84e1addc135c18b1227e7c00e7c03163.tar.gz
samba-4bb9cebf84e1addc135c18b1227e7c00e7c03163.tar.bz2
samba-4bb9cebf84e1addc135c18b1227e7c00e7c03163.zip
Tidy up debug in notify code.
Jeremy. (This used to be commit 7707c5e07385ce5ac3732715d586ad6c6b41de65)
Diffstat (limited to 'source3/smbd/notify_hash.c')
-rw-r--r--source3/smbd/notify_hash.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/source3/smbd/notify_hash.c b/source3/smbd/notify_hash.c
index d398fac214..415e4bcbda 100644
--- a/source3/smbd/notify_hash.c
+++ b/source3/smbd/notify_hash.c
@@ -30,10 +30,10 @@ struct change_data {
unsigned int num_entries; /* Zero or the number of files in the directory. */
};
-
/****************************************************************************
Create the hash we will use to determine if the contents changed.
*****************************************************************************/
+
static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags,
struct change_data *data, struct change_data *old_data)
{
@@ -47,7 +47,8 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags,
ZERO_STRUCTP(data);
- if(vfs_stat(conn,path, &st) == -1) return False;
+ if(vfs_stat(conn,path, &st) == -1)
+ return False;
data->modify_time = st.st_mtime;
data->status_time = st.st_ctime;
@@ -73,10 +74,12 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags,
* larger than the max time_t value).
*/
- if (!(flags & (FILE_NOTIFY_CHANGE_SIZE|FILE_NOTIFY_CHANGE_LAST_WRITE))) return True;
+ if (!(flags & (FILE_NOTIFY_CHANGE_SIZE|FILE_NOTIFY_CHANGE_LAST_WRITE)))
+ return True;
dp = OpenDir(conn, path, True);
- if (dp == NULL) return False;
+ if (dp == NULL)
+ return False;
data->num_entries = 0;
@@ -88,7 +91,8 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags,
p = &full_name[fullname_len];
while ((fname = ReadDirName(dp))) {
- if(strequal(fname, ".") || strequal(fname, "..")) continue;
+ if(strequal(fname, ".") || strequal(fname, ".."))
+ continue;
data->num_entries++;
safe_strcpy(p, fname, remaining_len);
@@ -107,15 +111,16 @@ static BOOL notify_hash(connection_struct *conn, char *path, uint32 flags,
return True;
}
-
/****************************************************************************
-register a change notify request
+ Register a change notify request.
*****************************************************************************/
+
static void *hash_register_notify(connection_struct *conn, char *path, uint32 flags)
{
struct change_data data;
- if (!notify_hash(conn, path, flags, &data, NULL)) return NULL;
+ if (!notify_hash(conn, path, flags, &data, NULL))
+ return NULL;
data.last_check_time = time(NULL);
@@ -160,17 +165,18 @@ static BOOL hash_check_notify(connection_struct *conn, uint16 vuid, char *path,
}
/****************************************************************************
-remove a change notify data structure
+ Remove a change notify data structure.
*****************************************************************************/
+
static void hash_remove_notify(void *datap)
{
SAFE_FREE(datap);
}
-
/****************************************************************************
-setup hash based change notify
+ Setup hash based change notify.
****************************************************************************/
+
struct cnotify_fns *hash_notify_init(void)
{
static struct cnotify_fns cnotify;
@@ -183,7 +189,6 @@ struct cnotify_fns *hash_notify_init(void)
return &cnotify;
}
-
/*
change_notify_reply_packet(cnbp->request_buf,ERRSRV,ERRaccess);
change_notify_reply_packet(cnbp->request_buf,0,NT_STATUS_NOTIFY_ENUM_DIR);