snprintf(fn, SIZ, "/tmp/foolog_%s.%d", Ctx->ServiceName, Ctx->cs_pid);
fd = fopen(fn, "a+");
- if (fd)
- {
- fprintf(fd, "Sending: BufSize: %d BufContent: [",
- nbytes);
- rv = fwrite(buf, nbytes, 1, fd);
- fprintf(fd, "]\n");
- fclose(fd);
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
}
+ fprintf(fd, "Sending: BufSize: %d BufContent: [",
+ nbytes);
+ rv = fwrite(buf, nbytes, 1, fd);
+ fprintf(fd, "]\n");
+ fclose(fd);
}
#endif
// flush_client_inbuf();
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
fprintf(fd, "Reading BLOB: BufSize: %d ",
bytes);
rv = fwrite(ChrPtr(Target), StrLength(Target), 1, fd);
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
fprintf(fd, "Read: %d BufContent: [",
StrLength(Target));
rv = fwrite(ChrPtr(Target), StrLength(Target), 1, fd);
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
fprintf(fd, "Reading BLOB: BufSize: %d ",
bytes);
rv = fwrite(ChrPtr(Target), StrLength(Target), 1, fd);
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
fprintf(fd, "Read: %d BufContent: [",
StrLength(Target));
rv = fwrite(ChrPtr(Target), StrLength(Target), 1, fd);
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
fprintf(fd, "Read: BufSize: %d BufContent: [",
StrLength(Target));
rv = fwrite(ChrPtr(Target), StrLength(Target), 1, fd);
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
pch = ChrPtr(CCC->RecvBuf.Buf);
len = StrLength(CCC->RecvBuf.Buf);
if (CCC->RecvBuf.ReadWritePointer != NULL)
snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
fd = fopen(fn, "a+");
+ if (fd == NULL) {
+ syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+ cit_backtrace();
+ exit(1);
+ }
pch = ChrPtr(CCC->RecvBuf.Buf);
len = StrLength(CCC->RecvBuf.Buf);
if (CCC->RecvBuf.ReadWritePointer != NULL)
}
-
+const char *WorkerLogStr = "W";
/*
* This loop just keeps going and going and going...
*/
++num_workers;
pthread_mutex_unlock(&ThreadCountMutex);
+ pthread_setspecific(evConKey, WorkerLogStr);
+
while (!server_shutting_down) {
/* make doubly sure we're not holding any stale db handles