Пример #1
0
static int
mount_local_mknod (const char *path, mode_t mode, dev_t rdev)
{
  int r;
  DECL_G ();
  DEBUG_CALL ("%s, 0%o, 0x%jx", path, mode, (uintmax_t) rdev);

  if (g->ml_read_only) return -EROFS;

  dir_cache_invalidate (g, path);

  r = guestfs_mknod (g, mode, major (rdev), minor (rdev), path);
  if (r == -1)
    RETURN_ERRNO;

  return 0;
}
Пример #2
0
static int
fg_mknod (const char *path, mode_t mode, dev_t rdev)
{
  TRACE_CALL ("%s, 0%o, 0x%lx", path, mode, (long) rdev);

  int r;

  if (read_only) return -EROFS;

  dir_cache_invalidate (path);

  r = guestfs_mknod (g, mode, major (rdev), minor (rdev), path);
  if (r == -1)
    return error ();

  return 0;
}