s3:smbd: add change_notify_fsp_has_changes()
authorStefan Metzmacher <metze@samba.org>
Tue, 5 Jun 2012 07:36:36 +0000 (09:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 6 Jun 2012 08:18:37 +0000 (10:18 +0200)
metze

source3/smbd/notify.c
source3/smbd/proto.h

index 0401b65a6a65511d9d73e05891a273913d5fc915..a55be9b9384c6097255a91904bd587edff609647 100644 (file)
@@ -39,6 +39,23 @@ struct notify_change_request {
 
 static void notify_fsp(files_struct *fsp, uint32 action, const char *name);
 
+bool change_notify_fsp_has_changes(struct files_struct *fsp)
+{
+       if (fsp == NULL) {
+               return false;
+       }
+
+       if (fsp->notify == NULL) {
+               return false;
+       }
+
+       if (fsp->notify->num_changes == 0) {
+               return false;
+       }
+
+       return true;
+}
+
 /*
  * For NTCancel, we need to find the notify_change_request indexed by
  * mid. Separate list here.
index e9365661be167d4c593bd0223530576b18cadaeb..03a09cd27e3625132cb79ba9b4c8995808c94366 100644 (file)
@@ -496,6 +496,7 @@ void reply_negprot(struct smb_request *req);
 
 /* The following definitions come from smbd/notify.c  */
 
+bool change_notify_fsp_has_changes(struct files_struct *fsp);
 void change_notify_reply(struct smb_request *req,
                         NTSTATUS error_code,
                         uint32_t max_param,