Lines Matching refs:mtab
74 struct mtab_handle *mtab;
76 mtab = g_new0 (struct mtab_handle, 1);
77 mtab->n_mounts = getmntinfo (&mtab->mounts, MNT_NOWAIT);
78 if (mtab->n_mounts == 0) {
79 g_free (mtab);
83 *handle = mtab;
98 struct mtab_handle *mtab = handle;
100 if (mtab->iter < mtab->n_mounts)
101 return mtab->mounts[mtab->iter++].f_mntfromname;
320 /* check hal's mtab file to verify the device to unmount is actually mounted by hal */
321 hal_mtab_orig = fopen ("/media/.hal-mtab", "r");
323 unknown_error ("Cannot open /media/.hal-mtab");
326 unknown_error ("Cannot seek to end of /media/.hal-mtab");
330 unknown_error ("Cannot determine size of /media/.hal-mtab");
336 unknown_error ("Cannot read from /media/.hal-mtab");
414 not_mounted_by_hal ("Device to unmount is not in /media/.hal-mtab so it is not mounted by HAL");
427 /* create new .hal-mtab~ file without the entry we're going to unmount */
428 hal_mtab_new = fopen ("/media/.hal-mtab~", "w");
430 unknown_error ("Cannot create /media/.hal-mtab~");
436 unknown_error ("Cannot write to /media/.hal-mtab~");
441 unknown_error ("Cannot write to /media/.hal-mtab~");
476 unlink ("/media/.hal-mtab~");
485 unlink ("/media/.hal-mtab~");
488 unlink ("/media/.hal-mtab~");
508 unlink ("/media/.hal-mtab~");
512 /* set new .hal-mtab file */
513 if (rename ("/media/.hal-mtab~", "/media/.hal-mtab") != 0) {
514 unlink ("/media/.hal-mtab~");
515 unknown_error ("Cannot rename /media/.hal-mtab~ to /media/.hal-mtab");
635 printf ("%d: XYA attempting to get lock on /media/.hal-mtab-lock\n", getpid ());
637 lock_mtab_fd = open ("/media/.hal-mtab-lock", O_CREAT | O_RDWR);
653 printf ("%d: XYA got lock on /media/.hal-mtab-lock\n", getpid ());
669 printf ("%d: XYA released lock on /media/.hal-mtab-lock\n", getpid ());