Blame SOURCES/autofs-5.1.6-use-master_list_empty-for-list-empty-check.patch

49b67f
autofs-5.1.6 - use master_list_empty() for list empty check
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
For consistency use the master_list_empty() function for list empty
49b67f
checks everywhere.
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG          |    1 +
49b67f
 daemon/automount.c |    2 +-
49b67f
 daemon/master.c    |   24 +++++++++++++++++-------
49b67f
 include/master.h   |    1 +
49b67f
 4 files changed, 20 insertions(+), 8 deletions(-)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -134,6 +134,7 @@ xx/xx/2018 autofs-5.1.5
49b67f
 - only add expre alarm for active mounts.
49b67f
 - move submount check into conditional_alarm_add().
49b67f
 - move lib/master.c to daemon/master.c.
49b67f
+- use master_list_empty() for list empty check.
49b67f
 
49b67f
 19/12/2017 autofs-5.1.4
49b67f
 - fix spec file url.
49b67f
--- autofs-5.1.4.orig/daemon/automount.c
49b67f
+++ autofs-5.1.4/daemon/automount.c
49b67f
@@ -1596,7 +1596,7 @@ static void *statemachine(void *arg)
49b67f
 		case SIGUSR2:
49b67f
 			master_mutex_lock();
49b67f
 			if (list_empty(&master_list->completed)) {
49b67f
-				if (list_empty(&master_list->mounts)) {
49b67f
+				if (__master_list_empty(master_list)) {
49b67f
 					master_mutex_unlock();
49b67f
 					return NULL;
49b67f
 				}
49b67f
--- autofs-5.1.4.orig/daemon/master.c
49b67f
+++ autofs-5.1.4/daemon/master.c
49b67f
@@ -1110,7 +1110,7 @@ int master_read_master(struct master *ma
49b67f
 			master_mount_mounts(master, age);
49b67f
 	}
49b67f
 
49b67f
-	if (list_empty(&master->mounts))
49b67f
+	if (__master_list_empty(master))
49b67f
 		warn(logopt, "no mounts in table");
49b67f
 
49b67f
 	master_mutex_unlock();
49b67f
@@ -1625,7 +1625,7 @@ int dump_map(struct master *master, cons
49b67f
 {
49b67f
 	struct list_head *p, *head;
49b67f
 
49b67f
-	if (list_empty(&master->mounts)) {
49b67f
+	if (__master_list_empty(master)) {
49b67f
 		printf("no master map entries found\n");
49b67f
 		return 1;
49b67f
 	}
49b67f
@@ -1743,7 +1743,7 @@ int master_show_mounts(struct master *ma
49b67f
 		printf("global options %s be appended to map entries\n", append);
49b67f
 	}
49b67f
 
49b67f
-	if (list_empty(&master->mounts)) {
49b67f
+	if (__master_list_empty(master)) {
49b67f
 		printf("no master map entries found\n\n");
49b67f
 		return 1;
49b67f
 	}
49b67f
@@ -1831,13 +1831,22 @@ int master_show_mounts(struct master *ma
49b67f
 	return 1;
49b67f
 }
49b67f
 
49b67f
-int master_list_empty(struct master *master)
49b67f
+int __master_list_empty(struct master *master)
49b67f
 {
49b67f
 	int res = 0;
49b67f
 
49b67f
-	master_mutex_lock();
49b67f
 	if (list_empty(&master->mounts))
49b67f
 		res = 1;
49b67f
+
49b67f
+	return res;
49b67f
+}
49b67f
+
49b67f
+int master_list_empty(struct master *master)
49b67f
+{
49b67f
+	int res;
49b67f
+
49b67f
+	master_mutex_lock();
49b67f
+	res = __master_list_empty(master);
49b67f
 	master_mutex_unlock();
49b67f
 
49b67f
 	return res;
49b67f
@@ -1859,7 +1868,8 @@ int master_done(struct master *master)
49b67f
 		master_free_mapent_sources(entry, 1);
49b67f
 		master_free_mapent(entry);
49b67f
 	}
49b67f
-	if (list_empty(&master->mounts))
49b67f
+
49b67f
+	if (__master_list_empty(master))
49b67f
 		res = 1;
49b67f
 
49b67f
 	return res;
49b67f
@@ -1872,7 +1882,7 @@ unsigned int master_get_logopt(void)
49b67f
 
49b67f
 int master_kill(struct master *master)
49b67f
 {
49b67f
-	if (!list_empty(&master->mounts))
49b67f
+	if (!master_list_empty(master))
49b67f
 		return 0;
49b67f
 
49b67f
 	if (master->name)
49b67f
--- autofs-5.1.4.orig/include/master.h
49b67f
+++ autofs-5.1.4/include/master.h
49b67f
@@ -123,6 +123,7 @@ int master_mount_mounts(struct master *,
49b67f
 int dump_map(struct master *, const char *, const char *);
49b67f
 int master_show_mounts(struct master *);
49b67f
 unsigned int master_get_logopt(void);
49b67f
+int __master_list_empty(struct master *);
49b67f
 int master_list_empty(struct master *);
49b67f
 int master_done(struct master *);
49b67f
 int master_kill(struct master *);