• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/autofs-234/automount/

Lines Matching +defs:target +defs:dir

104 	struct autodir *dir, *d;
307 for (dir = dir_head; dir; dir = dir->dir_next) {
309 if (realpath(dir->dir_name, real_mntpnt) == NULL) {
321 dir->dir_name);
324 dir->dir_realpath = NULL;
326 dir->dir_realpath = strdup(real_mntpnt);
327 if (dir->dir_realpath == NULL) {
336 if (strcmp(dir->dir_map, "-null") == 0)
343 for (d = dir->dir_prev; d; d = d->dir_prev) {
344 if (paths_match(dir, d))
359 if (strcmp(dir->dir_map, "-fstab") == 0) {
365 free(dir->dir_map);
366 dir->dir_map = strdup("-null");
382 if (strcmp(dir->dir_map, "-fstab") == 0 ||
383 strcmp(dir->dir_map, "-static") == 0) {
385 if (paths_match(dir, d) &&
389 dir->dir_name, dir->dir_map);
404 if (!parse_mntopts(dir->dir_opts, &flags, &altflags)) {
416 if (strcmp(dir->dir_map, "-static") == 0) {
417 static_ent = get_staticmap_entry(dir->dir_name);
425 dir->dir_name);
435 dir->dir_name);
446 if (dir->dir_realpath != NULL &&
447 (mntp = find_mount(dir->dir_realpath)) != NULL) {
456 mntp->f_mntfromname, dir->dir_realpath);
469 au.opts = dir->dir_opts;
470 au.map = dir->dir_map;
472 au.direct = dir->dir_direct;
473 au.node_type = dir->dir_direct ? NT_TRIGGER : 0;
477 pr_msg("update %s: %m", dir->dir_realpath);
481 pr_msg("%s updated", dir->dir_realpath);
494 * future problems. (We don't use dir->dir_realpath
497 if (lstat(dir->dir_name, &stbuf) == 0) {
499 pr_msg("%s: Not a directory", dir->dir_name);
510 * the problem isn't that "dir->dir_name"
515 if (dir->dir_realpath == NULL) {
518 dir->dir_name);
529 if (strncmp(dir->dir_name, "/Volumes/", 9) == 0) {
530 pr_msg("%s: mountpoint unavailable", dir->dir_name);
534 if (mkdir_r(dir->dir_name)) {
535 pr_msg("%s: %m", dir->dir_name);
541 * as dir->dir_name couldn't be statted.
546 if (realpath(dir->dir_name, real_mntpnt) == NULL) {
551 dir->dir_name);
554 dir->dir_realpath = strdup(real_mntpnt);
555 if (dir->dir_realpath == NULL) {
557 dir->dir_name);
572 if (chflags(dir->dir_name, st_flags) < 0)
573 pr_msg("%s: can't set hidden", dir->dir_name);
580 ai.path = dir->dir_realpath;
581 ai.opts = dir->dir_opts;
582 ai.map = dir->dir_map;
584 ai.direct = dir->dir_direct;
585 if (dir->dir_direct)
586 ai.key = dir->dir_name;
591 ai.node_type = dir->dir_direct ? NT_TRIGGER : 0;
593 if (mount(MNTTYPE_AUTOFS, dir->dir_realpath,
596 pr_msg("mount %s: %m", dir->dir_realpath);
600 pr_msg("%s mounted", dir->dir_realpath);
631 make_symlink(const char *target, const char *path)
640 * Does the target exist?
656 pr_msg("can't read target of %s: %m", path);
670 if (strcmp(linktarget, target) == 0) {
732 * lstat() failed; is it because the target doesn't
746 * OK, the target should not exist.
749 if (symlink(target, path) == -1) {
751 path, target);
755 * Validate the symlink in case the path and target
759 pr_msg("Invalid symbolic link: %s to %s: %m", path, target);
838 struct autodir *dir;
867 for (dir = dir_head; dir; dir = dir->dir_next) {
868 if (dir->dir_realpath != NULL &&
869 strcmp(dir->dir_realpath, mnt->f_mntonname) == 0) {
870 current = strcmp(dir->dir_map, "-null");
935 mkdir_r(dir)
936 char *dir;
941 if (mkdir(dir, 0555) == 0) {
967 slash = strrchr(dir, '/');
971 err = mkdir_r(dir);
975 return (mkdir(dir, 0555));