Bug 324930 - Nicer message for EPERM on symlink
authorStéphane Démurget <stephane.demurget@free.fr>
Sun, 25 Oct 2009 10:14:36 +0000 (11:14 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 5 Nov 2009 13:31:14 +0000 (14:31 +0100)
Introduced a more precise error message for EPERM when symlinking to
a local filesystem.

EPERM on symlink means symlinking is not supported by the underlying
fs so it is not the general meaning of EPERM which roughly translates
to 'Operation not permitted'.

gio/glocalfile.c

index f6036e33d5385a56b97a194530fdb28def868286..6a42f530c492631d96445e0dfc20c8dce47da651 100644 (file)
@@ -2151,6 +2151,10 @@ g_local_file_make_symbolic_link (GFile         *file,
        g_set_error_literal (error, G_IO_ERROR,
                              G_IO_ERROR_INVALID_FILENAME,
                              _("Invalid filename"));
+      else if (errsv == EPERM)
+       g_set_error (error, G_IO_ERROR,
+                    G_IO_ERROR_NOT_SUPPORTED,
+                    _("Filesystem does not support symbolic links"));
       else
        g_set_error (error, G_IO_ERROR,
                     g_io_error_from_errno (errsv),