void UpdateCdStats(BOOL verbose) { FILE *fp; int files, bytes, images, capacity; static char *fid = "UpdateCdStats"; sprintf(CommandLine, "%s %s %s", STATS_SCRIPT, Syscode, CdStatsFile); if (!ExecuteSystemCommand(CommandLine, verbose)) return; if ((fp = fopen(CdStatsFile, "r")) == NULL) { util_log(1, "%s: fopen: %s: %s", fid, CdStatsFile, strerror(errno) ); return; } fscanf(fp, "%d %d %d %d", &files, &bytes, &images, &capacity); fclose(fp); MUTEX_LOCK(&Status->lock); Status->output.file = files; Status->buffer.nrec = bytes; Status->output.nrec = images; Status->buffer.capacity = capacity; MUTEX_UNLOCK(&Status->lock); unlink(CdStatsFile); }
static THREAD_FUNC FlushIsoImageThread(void *unused) { static char *fid = "FlushIsoImageThread"; sprintf(CommandLine, "%s FORCE %s", FORCE_ISO_SCRIPT, Syscode); ExecuteSystemCommand(CommandLine, TRUE); UpdateCdStats(FALSE); ActiveFlag = FALSE; }
bool Process::ExecuteSystemCommand (/*[in]*/ const char * lpszCommandLine, /*[out]*/ int * pExitCode) { return (ExecuteSystemCommand(lpszCommandLine, pExitCode, 0, 0)); }
bool Process::ExecuteSystemCommand (/*[in]*/ const char * lpszCommandLine) { return (ExecuteSystemCommand(lpszCommandLine, 0, 0, 0)); }
int eject_cdrom(int unused) { static char *CommandLine = "eject cdrom"; return ExecuteSystemCommand(CommandLine, TRUE) ? 0 : -1; }