- long t, time();
- char *time_s;
-
- time(&t);
- time_s = ctime(&t) + 4;
- time_s[strlen(time_s)-6] = '\0';
-
- fprintf(crit, "%s <%d> %s\n", time_s, getpid(), buf);
- fclose(crit);
+ time_t t;
+ char *time_s;
+
+ time(&t);
+ time_s = ctime(&t) + 4;
+ time_s[strlen(time_s) - 6] = '\0';
+
+ fprintf(crit, "%s <%ld>", time_s, (long)getpid());
+ start = ftell(crit);
+ va_start(ap, msg);
+ vfprintf(crit, msg, ap);
+ va_end(ap);
+ fprintf(crit, "\n");
+
+ buf = malloc(ftell(crit) - start);
+ fclose(crit);
+
+ if (buf)
+ {
+ va_start(ap, msg);
+ vsprintf(buf, msg, ap);
+ va_end(ap);
+
+ send_zgram(instance, buf);
+ com_err(whoami, 0, buf);
+
+ free(buf);
+ }