1 diff --git a/CHANGELOG b/CHANGELOG
2 index 5aee44c..9c99966 100644
6 - don't fail on empty master map.
7 - add support for the "%" hack for case insensitive attribute schemas.
8 - fix "nosymlink" option handling and add desription to man page.
9 +- fix don't fail on empty master map.
11 18/06/2007 autofs-5.0.2
12 -----------------------
13 diff --git a/daemon/automount.c b/daemon/automount.c
14 index 9809b9c..7b79f02 100644
15 --- a/daemon/automount.c
16 +++ b/daemon/automount.c
17 @@ -61,6 +61,8 @@ static size_t kpkt_len;
19 /* Attribute to create detached thread */
20 pthread_attr_t thread_attr;
21 +/* Attribute to create normal thread */
22 +pthread_attr_t thread_attr_nodetach;
24 struct master_readmap_cond mrc = {
25 PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, NULL, 0, 0, 0, 0};
26 @@ -914,7 +916,7 @@ static void *do_notify_state(void *arg)
30 -static int do_signals(struct master *master, int sig)
31 +static pthread_t do_signals(struct master *master, int sig)
35 @@ -924,7 +926,7 @@ static int do_signals(struct master *master, int sig)
39 - status = pthread_create(&thid, &thread_attr, do_notify_state, &r_sig);
40 + status = pthread_create(&thid, &thread_attr_nodetach, do_notify_state, &r_sig);
42 error(master->default_logging,
43 "mount state notify thread create failed");
44 @@ -948,7 +950,7 @@ static int do_signals(struct master *master, int sig)
46 pthread_cleanup_pop(1);
52 static void *do_read_master(void *arg)
53 @@ -1038,6 +1040,7 @@ static int do_hup_signal(struct master *master, time_t age)
54 /* Deal with all the signal-driven events in the state machine */
55 static void *statemachine(void *arg)
61 @@ -1048,15 +1051,17 @@ static void *statemachine(void *arg)
63 sigwait(&signalset, &sig);
66 - if (master_list_empty(master_list))
73 - do_signals(master_list, sig);
74 + thid = do_signals(master_list, sig);
76 + pthread_join(thid, NULL);
77 + if (master_list_empty(master_list))
84 @@ -1171,10 +1176,6 @@ static void handle_mounts_cleanup(void *arg)
86 msg("shut down path %s", path);
88 - /* If we are the last tell the state machine to shutdown */
89 - if (!submount && master_list_empty(master_list))
90 - kill(getpid(), SIGTERM);
95 @@ -1644,6 +1645,14 @@ int main(int argc, char *argv[])
99 + if (pthread_attr_init(&thread_attr_nodetach)) {
101 + "%s: failed to init thread attribute struct!",
103 + close(start_pipefd[1]);
107 msg("Starting automounter version %s, master map %s",
108 version, master_list->name);
109 msg("using kernel protocol version %d.%02d",
110 diff --git a/lib/master.c b/lib/master.c
111 index 9f24f7e..da05bb6 100644
114 @@ -802,7 +802,7 @@ int master_read_master(struct master *master, time_t age, int readall)
116 if (list_empty(&master->mounts)) {
117 master_mutex_unlock();
118 - error(LOGOPT_ANY, "no mounts in table");
119 + warn(LOGOPT_ANY, "no mounts in table");