int main( int argc, char **argv ) { int LocalStatus; iRODSNtServerCheckExecMode( argc, argv ); iRODSNtSetServerHomeDir( argv[0] ); if ( iRODSNtServerRunningConsoleMode() ) { LocalStatus = irodsWinMain( argc, argv ); } else { /* service mode */ if ( iRODSNtGetServiceName( irods_service_name ) < 0 ) { exit( 0 ); } LocalStatus = irodsNtRunService( argc, argv ); } return LocalStatus; }
static void rodsNtElog(char *msg) { char log_fname[1024]; int fd; int t; if(ProcessType == CLIENT_PT) { fprintf(stderr,"%s", msg); return; } t = strlen(msg); if(msg[t-1] == '\n') { msg[t-1] = '\0'; t = t -1; } if(iRODSNtServerRunningConsoleMode()) { t = strlen(msg); if(msg[t-1] == '\n') fprintf(stderr,"%s",msg); else fprintf(stderr,"%s\n",msg); return; } t = strlen(msg); if(msg[t-1] != '\n') { msg[t] = '\n'; msg[t+1] = '\0'; t = t +1; } iRODSNtGetLogFilenameWithPath(log_fname); fd = iRODSNt_open(log_fname, O_APPEND|O_WRONLY,1); _write(fd,msg,t); _close(fd); }