Commit d4eaf35d d4eaf35d1315fdc836d8b6a258be01dd86353e85 by Sean 'Shaleh' Perry

fixed compilation problems I introduced yesterday

1 parent 043c0d97
1 Sean 'Shaleh' Perry <shaleh@debian.org> Wed, 6 Oct 1999 13:55:42 -0700
2
3 * Cleanup some compilation issues
4
1 Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 5 Oct 1999 23:06:33 -0700 5 Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 5 Oct 1999 23:06:33 -0700
2 6
3 * Added changelog.pl so we can have automated entries 7 * Added changelog.pl so we can have automated entries
......
...@@ -17,9 +17,10 @@ ...@@ -17,9 +17,10 @@
17 17
18 #include "pop3d.h" 18 #include "pop3d.h"
19 19
20 /* save some line space */
20 typedef struct sockaddr_in SA; 21 typedef struct sockaddr_in SA;
21 22
22 /* count of number of child processes */ 23 /* number of child processes */
23 unsigned int children = 0; 24 unsigned int children = 0;
24 25
25 static struct option long_options[] = 26 static struct option long_options[] =
...@@ -143,7 +144,7 @@ pop3_daemon_init (void) ...@@ -143,7 +144,7 @@ pop3_daemon_init (void)
143 pid = fork(); 144 pid = fork();
144 if (pid == -1) 145 if (pid == -1)
145 { 146 {
146 perror(errno); 147 perror("fork failed:");
147 exit (-1); 148 exit (-1);
148 } 149 }
149 else if (pid > 0) 150 else if (pid > 0)
...@@ -156,7 +157,7 @@ pop3_daemon_init (void) ...@@ -156,7 +157,7 @@ pop3_daemon_init (void)
156 pid = fork(); 157 pid = fork();
157 if (pid == -1) 158 if (pid == -1)
158 { 159 {
159 perror(errno); 160 perror("fork failed:");
160 exit (-1); 161 exit (-1);
161 } 162 }
162 else if (pid > 0) 163 else if (pid > 0)
...@@ -295,18 +296,20 @@ pop3_daemon (unsigned int maxchildren) ...@@ -295,18 +296,20 @@ pop3_daemon (unsigned int maxchildren)
295 SA server, client; 296 SA server, client;
296 pid_t pid; 297 pid_t pid;
297 int listenfd, connfd; 298 int listenfd, connfd;
299 size_t size;
298 300
299 if ( (listenfd = socket (AF_INET, SOCK_STREAM, 0)) == -1 ) 301 if ( (listenfd = socket (AF_INET, SOCK_STREAM, 0)) == -1 )
300 { 302 {
301 syslog (LOG_ERR, "socket: %s", strerror(errno)); 303 syslog (LOG_ERR, "socket: %s", strerror(errno));
302 exit (-1); 304 exit (-1);
303 } 305 }
304 memset (&server, 0, sizeof(server)); 306 size = sizeof(server);
307 memset (&server, 0, size);
305 server.sin_family = AF_INET; 308 server.sin_family = AF_INET;
306 server.sin_addr.s_addr = htonl (INADDR_ANY); 309 server.sin_addr.s_addr = htonl (INADDR_ANY);
307 server.sin_port = htonl (port); 310 server.sin_port = htonl (port);
308 311
309 if (bind(listenfd, (SA *) &server, sizeof(server)) == -1 ) 312 if (bind(listenfd, (SA *) &server, size) == -1 )
310 { 313 {
311 syslog(LOG_ERR, "bind: %s", strerror(errno)); 314 syslog(LOG_ERR, "bind: %s", strerror(errno));
312 exit(-1); 315 exit(-1);
...@@ -325,7 +328,7 @@ pop3_daemon (unsigned int maxchildren) ...@@ -325,7 +328,7 @@ pop3_daemon (unsigned int maxchildren)
325 pause(); 328 pause();
326 continue; 329 continue;
327 } 330 }
328 if ( (connfd = accept(listenfd, (SA *) &client, sizeof(client))) == -1) 331 if ( (connfd = accept(listenfd, (SA *) &client, &size)) == -1)
329 { 332 {
330 syslog(LOG_ERR, "accept: %s", strerror(errno)); 333 syslog(LOG_ERR, "accept: %s", strerror(errno));
331 exit(-1); 334 exit(-1);
......
...@@ -143,6 +143,7 @@ int ifile; ...@@ -143,6 +143,7 @@ int ifile;
143 FILE *ofile; 143 FILE *ofile;
144 time_t curr_time; 144 time_t curr_time;
145 char *md5shared; 145 char *md5shared;
146 unsigned int children;
146 147
147 int pop3_dele (const char *arg); 148 int pop3_dele (const char *arg);
148 int pop3_list (const char *arg); 149 int pop3_list (const char *arg);
...@@ -165,7 +166,7 @@ int pop3_lock (void); ...@@ -165,7 +166,7 @@ int pop3_lock (void);
165 int pop3_unlock (void); 166 int pop3_unlock (void);
166 int pop3_getsizes (void); 167 int pop3_getsizes (void);
167 int pop3_mainloop (int infile, int outfile); 168 int pop3_mainloop (int infile, int outfile);
168 int pop3_daemon (int maxchildren); 169 int pop3_daemon (unsigned int maxchildren);
169 void pop3_usage (char *argv0); 170 void pop3_usage (char *argv0);
170 void pop3_signal (int signal); 171 void pop3_signal (int signal);
171 void pop3_sigchld (int signal); 172 void pop3_sigchld (int signal);
......