#endif
#endif
#else /* AFS_VFSINCL_ENV */
-#ifdef AFS_OSF_ENV
-#include <ufs/inode.h>
-#else /* AFS_OSF_ENV */
#if !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_DARWIN_ENV)
#include <sys/inode.h>
#endif
-#endif
#endif /* AFS_VFSINCL_ENV */
#endif /* AFS_SGI_ENV */
#ifdef AFS_AIX_ENV
OPT_syslog,
OPT_syslogfacility,
OPT_logfile,
- OPT_client
+ OPT_client,
+ OPT_transarc_logs
};
static int
cmd_OptionAsFlag(opts, OPT_inodes, &ListInodeOption);
cmd_OptionAsFlag(opts, OPT_oktozap, &OKToZap);
cmd_OptionAsFlag(opts, OPT_rootinodes, &ShowRootFiles);
+ cmd_OptionAsFlag(opts, OPT_salvagedirs, &RebuildDirs);
cmd_OptionAsFlag(opts, OPT_blockreads, &forceR);
if (cmd_OptionAsString(opts, OPT_parallel, &optstring) == 0) {
+ char *input = optstring;
if (strncmp(optstring, "all", 3) == 0) {
PartsPerDisk = 1;
+ input += 3;
}
- if (strlen(optstring) != 0) {
- Parallel = atoi(optstring);
+ if (strlen(input) != 0) {
+ Parallel = atoi(input);
if (Parallel < 1)
Parallel = 1;
if (Parallel > MAXPARALLEL) {
fprintf(stderr, "Invalid options: -syslog and -logfile are exclusive.\n");
return -1;
}
-
+ if (cmd_OptionPresent(opts, OPT_transarc_logs)) {
+ fprintf(stderr, "Invalid options: -syslog and -transarc-logs are exclusive.\n");
+ return -1;
+ }
logopts.lopt_dest = logDest_syslog;
logopts.lopt_facility = LOG_DAEMON;
logopts.lopt_tag = "salvageserver";
#endif
{
logopts.lopt_dest = logDest_file;
- logopts.lopt_rotateOnOpen = 1;
- logopts.lopt_rotateStyle = logRotate_old;
-
+ if (cmd_OptionPresent(opts, OPT_transarc_logs)) {
+ logopts.lopt_rotateOnOpen = 1;
+ logopts.lopt_rotateStyle = logRotate_old;
+ }
if (cmd_OptionPresent(opts, OPT_logfile))
cmd_OptionAsString(opts, OPT_logfile, (char**)&logopts.lopt_filename);
else
cmd_AddParmAtOffset(ts, OPT_logfile, "-logfile", CMD_SINGLE, CMD_OPTIONAL,
"Location of log file ");
+ cmd_AddParmAtOffset(ts, OPT_transarc_logs, "-transarc-logs", CMD_FLAG,
+ CMD_OPTIONAL, "enable Transarc style logging");
+
err = cmd_Dispatch(argc, argv);
Exit(err);
- return 0; /* not reached */
+ AFS_UNREACHED(return 0);
}
static void
* another thread may have held the lock when fork was
* called!
*/
- memset(&memset, 0, sizeof(logopts));
+ memset(&logopts, 0, sizeof(logopts));
logopts.lopt_dest = logDest_file;
logopts.lopt_rotateStyle = logRotate_none;
if (asprintf(&filename, "%s.%d",
opr_cv_broadcast(&worker_cv);
}
- return NULL;
+ AFS_UNREACHED(return(NULL));
}
static int
}
}
- opr_mutex_exit(&worker_lock);
- return NULL;
+ AFS_UNREACHED(opr_mutex_exit(&worker_lock));
+ AFS_UNREACHED(return(NULL));
}
#define LOG_XFER_BUF_SIZE 65536
}
buf = calloc(1, LOG_XFER_BUF_SIZE);
- if (buf != NULL) {
+ if (buf == NULL) {
Log("Unable to write child log: out of memory\n");
goto done;
}