}
int
+afsd_check_mount(const char *rn, const char *mountdir)
+{
+ /* libuafs could provide a callback of some kind to let the user code
+ * specify a "is this mount point valid?" function, but for now there's
+ * no need for it. */
+ return 0;
+}
+
+int
afsd_call_syscall(long param1, long param2, long param3, long param4,
long param5)
{
{
static char rn[] = "afsd"; /*Name of this routine */
struct afsconf_dir *cdir; /* config dir */
- struct stat statbuf;
int lookupResult; /*Result of GetLocalCellName() */
int i;
afs_int32 code; /*Result of fork() */
}
if (!enable_nomount) {
- if (stat(afsd_cacheMountDir, &statbuf)) {
- printf("afsd: Mountpoint %s missing.\n", afsd_cacheMountDir);
- exit(1);
- } else {
- if (!S_ISDIR(statbuf.st_mode)) {
- printf("afsd: Mountpoint %s is not a directory.\n", afsd_cacheMountDir);
- exit(1);
- }
+ if (afsd_check_mount(rn, afsd_cacheMountDir)) {
+ return -1;
}
}
/* afsd.c expects these to be implemented; it does not implement them itself! */
void afsd_mount_afs(const char *rn, const char *mountdir);
+int afsd_check_mount(const char *rn, const char *mountdir);
void afsd_set_rx_rtpri(void);
void afsd_set_afsd_rtpri(void);
int afsd_call_syscall();
}
int
+afsd_check_mount(const char *rn, const char *mountdir)
+{
+ struct stat statbuf;
+
+ if (stat(mountdir, &statbuf)) {
+ printf("%s: Mountpoint %s missing.\n", rn, mountdir);
+ return -1;
+ } else if (!S_ISDIR(statbuf.st_mode)) {
+ printf("%s: Mountpoint %s is not a directory.\n", rn, mountdir);
+ return -1;
+ }
+ return 0;
+}
+
+int
main(int argc, char **argv)
{
int code;