masqmail-0.2
diff src/get.c @ 15:f671821d8222
code beautifying; 0 -> \0 if appropriate
author | meillo@marmaro.de |
---|---|
date | Thu, 06 Nov 2008 09:18:38 +0100 |
parents | 26e34ae9a3e3 |
children |
line diff
1.1 --- a/src/get.c Wed Oct 29 21:21:26 2008 +0100 1.2 +++ b/src/get.c Thu Nov 06 09:18:38 2008 +0100 1.3 @@ -62,8 +62,10 @@ 1.4 and the server name, to prevent more than one connection at the same time 1.5 to the same server and the same user. This way concurrent connections 1.6 are possible to different servers or different users */ 1.7 - hitch_name = g_strdup_printf("%s/masqmail-get-%s@%s-%d.lock", conf.lock_dir, gc->login_user, gc->server_name, getpid()); 1.8 - lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", conf.lock_dir, gc->login_user, gc->server_name); 1.9 + hitch_name = g_strdup_printf("%s/masqmail-get-%s@%s-%d.lock", 1.10 + conf.lock_dir, gc->login_user, gc->server_name, getpid()); 1.11 + lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", 1.12 + conf.lock_dir, gc->login_user, gc->server_name); 1.13 1.14 ok = dot_lock(lock_name, hitch_name); 1.15 if (!ok) 1.16 @@ -98,7 +100,8 @@ 1.17 static gboolean 1.18 get_unlock(get_conf * gc) 1.19 { 1.20 - gchar *lock_name lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", conf.lock_dir, gc->login_user, gc->server_name); 1.21 + gchar *lock_name lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", 1.22 + conf.lock_dir, gc->login_user, gc->server_name); 1.23 1.24 dot_unlock(lock_name); 1.25 g_free(lock_name); 1.26 @@ -109,7 +112,8 @@ 1.27 static void 1.28 get_unlock(get_conf * gc, int fd) 1.29 { 1.30 - gchar *lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", conf.lock_dir, gc->login_user, gc->server_name); 1.31 + gchar *lock_name = g_strdup_printf("%s/masqmail-get-%s@%s.lock", 1.32 + conf.lock_dir, gc->login_user, gc->server_name); 1.33 1.34 flock(fd, LOCK_UN); 1.35 close(fd); 1.36 @@ -351,8 +355,7 @@ 1.37 } 1.38 } 1.39 } else { 1.40 - /* If select returns 0, the interval time has elapsed. 1.41 - We start a new get process */ 1.42 + /* If select returns 0, the interval time has elapsed. We start a new get process */ 1.43 int pid; 1.44 signal(SIGCHLD, sigchld_handler); 1.45 if ((pid = fork()) == 0) { 1.46 @@ -384,7 +387,8 @@ 1.47 ok = pop3_login(gc->server_name, gc->server_port, resolve_list, gc->login_user, gc->login_pass, flags); 1.48 } else if (strcmp(gc->protocol, "apop") == 0) { 1.49 DEBUG(3) debugf ("attempting to login for user %s, host = %s with apop\n", gc->login_user, gc->server_name); 1.50 - ok = pop3_login(gc->server_name, gc->server_port, resolve_list, gc->login_user, gc->login_pass, flags | POP3_FLAG_APOP); 1.51 + ok = pop3_login(gc->server_name, gc->server_port, resolve_list, gc->login_user, 1.52 + gc->login_pass, flags | POP3_FLAG_APOP); 1.53 } else { 1.54 logwrite(LOG_ALERT, "get protocol %s unknown\n", gc->protocol); 1.55 }