projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ancora correzioni sulle varie versioni di server.
[gapil.git]
/
sources
/
TCP_echod.c
diff --git
a/sources/TCP_echod.c
b/sources/TCP_echod.c
index 049155744c919942c335a3a5f3b818ce0005990f..25a457187e4d000071e59623967d67938163a216 100644
(file)
--- a/
sources/TCP_echod.c
+++ b/
sources/TCP_echod.c
@@
-26,7
+26,7
@@
*
* Usage: echod -h give all info
*
*
* Usage: echod -h give all info
*
- * $Id: TCP_echod.c,v 1.
8 2003/07/27 14:28:19
piccardi Exp $
+ * $Id: TCP_echod.c,v 1.
10 2003/07/29 22:41:36
piccardi Exp $
*
****************************************************************/
/*
*
****************************************************************/
/*
@@
-41,7
+41,7
@@
#include <syslog.h> /* syslog system functions */
#include <signal.h> /* signal functions */
#include <errno.h> /* error code */
#include <syslog.h> /* syslog system functions */
#include <signal.h> /* signal functions */
#include <errno.h> /* error code */
-#include <string.h> /* error
code
*/
+#include <string.h> /* error
strings
*/
#include "Gapil.h"
#define BACKLOG 10
#include "Gapil.h"
#define BACKLOG 10
@@
-104,7
+104,7
@@
int main(int argc, char *argv[])
*
* ***********************************************************/
/* install SIGCHLD handler */
*
* ***********************************************************/
/* install SIGCHLD handler */
- Signal(SIGCHLD, HandSigCHLD); /* establish handler */
+ Signal
Restart
(SIGCHLD, HandSigCHLD); /* establish handler */
/* create socket */
if ( (list_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
perror("Socket creation error");
/* create socket */
if ( (list_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
perror("Socket creation error");
@@
-209,7
+209,7
@@
void ServEcho(int sockfd) {
}
}
nwrite = FullWrite(sockfd, buffer, nread);
}
}
nwrite = FullWrite(sockfd, buffer, nread);
- if (nwrite
< 0
) {
+ if (nwrite) {
snprintf(debug, MAXLINE+20, "Errore in scrittura: %s \n",
strerror(errno));
if (demonize) { /* daemon mode */
snprintf(debug, MAXLINE+20, "Errore in scrittura: %s \n",
strerror(errno));
if (demonize) { /* daemon mode */
@@
-234,8
+234,8
@@
void ServEcho(int sockfd) {
* routine to print error on stout or syslog
*/
void PrintErr(char * error) {
* routine to print error on stout or syslog
*/
void PrintErr(char * error) {
- if (demonize) { /* daemon mode */
- syslog(LOG_ERR,
error);
+ if (demonize) {
/* daemon mode */
+ syslog(LOG_ERR,
"%s: %m", error); /* log string and error message */
} else {
perror(error);
}
} else {
perror(error);
}