#include <roken.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
-# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+# ifdef __clang__
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+# else
+# pragma GCC diagnostic warning "-Wdeprecated-declarations"
+# endif
#endif
#define VFS 1
static int
os_syscall(struct afsd_syscall_args *args)
{
- int retval;
+ int retval, error;
error = ioctl_sun_afs_syscall(AFSCALL_CALL, args->syscall,
args->params[0], args->params[1],
error = os_syscall(args);
if (afsd_debug) {
-#ifdef AFS_NBSD40_ENV
- char *s = strerror(errno);
- printf("SScall(%d, %d, %d)=%d (%d, %s)\n", AFS_SYSCALL, AFSCALL_CALL,
- (int)args->params[0], error, errno, s);
-#else
- printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL,
- (int)args->params[0], error);
-#endif
+ if (error == -1) {
+ char *s = strerror(errno);
+ printf("SScall(%d, %d, %d)=%d (%d, %s)\n", AFS_SYSCALL, AFSCALL_CALL,
+ (int)args->params[0], error, errno, s);
+ } else {
+ printf("SScall(%d, %d, %d)=%d\n", AFS_SYSCALL, AFSCALL_CALL,
+ (int)args->params[0], error);
+ }
}
return error;
printf("%s: Mounting the AFS root on '%s', flags: %d.\n", rn,
cacheMountDir, mountFlags);
#if defined(AFS_FBSD60_ENV)
- /* data must be non-NULL but is otherwise ignored */
- if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, rn)) < 0) {
+ /* data must be non-const non-NULL but is otherwise ignored */
+ if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, &mountFlags)) < 0) {
#elif defined(AFS_FBSD_ENV)
if ((mount("AFS", cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
#elif defined(AFS_AIX_ENV)
} else if (!S_ISDIR(statbuf.st_mode)) {
printf("%s: Mountpoint %s is not a directory.\n", rn, mountdir);
return -1;
+ } else if (mountdir[0] != '/') {
+ printf("%s: Mountpoint %s is not an absolute path.\n", rn, mountdir);
+ return -1;
}
return 0;
}
afsd_init();
code = afsd_parse(argc, argv);
- if (code) {
+ if (code == CMD_HELP) {
+ return 0; /* Displaying help is not an error. */
+ }
+ if (code != 0) {
return -1;
}