Add a G_IO_ERROR_TOO_MANY_OPEN_FILES error code. Requested by Olivier

* gioenums.h: Add a G_IO_ERROR_TOO_MANY_OPEN_FILES error code.
        Requested by Olivier Sessink.

        * gioerror.c: Translate EMFILE to G_IO_ERROR_TOO_MANY_OPEN_FILES.

        * glocalfileenumerator.c: Translate G_FILE_ERROR_MFILE to
        G_IO_ERROR_TOO_MANY_OPEN_FILES.


svn path=/trunk/; revision=7782
This commit is contained in:
Matthias Clasen 2009-01-08 01:32:15 +00:00
parent 5cacbdae8d
commit 2479abee27
5 changed files with 32 additions and 6 deletions

View File

@ -1,3 +1,15 @@
2009-01-07 Matthias Clasen <mclasen@redhat.com>
Bug 566770 error code 0 for Too many open files is useless
* gioenums.h: Add a G_IO_ERROR_TOO_MANY_OPEN_FILES error code.
Requested by Olivier Sessink.
* gioerror.c: Translate EMFILE to G_IO_ERROR_TOO_MANY_OPEN_FILES.
* glocalfileenumerator.c: Translate G_FILE_ERROR_MFILE to
G_IO_ERROR_TOO_MANY_OPEN_FILES.
2009-01-05 Matthias Clasen <mclasen@redhat.com>
* === Released 2.19.4 ===

View File

@ -53,9 +53,9 @@
* #GDesktopAppInfo is an implementation of #GAppInfo based on
* desktop files.
*
* Note that GDesktopAppInfo belongs to the UNIX-specific GIO interfaces,
* thus you have to use the <filename>gio-unix-2.0.pc</filename> pkg-config
* file when using it.
* Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
* the UNIX-specific GIO interfaces, thus you have to use the
* <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
*/
#define DEFAULT_APPLICATIONS_GROUP "Default Applications"

View File

@ -328,7 +328,11 @@ typedef enum {
* @G_IO_ERROR_WOULD_BLOCK: Operation would block.
* @G_IO_ERROR_HOST_NOT_FOUND: Host couldn't be found (remote operations).
* @G_IO_ERROR_WOULD_MERGE: Operation would merge files.
* @G_IO_ERROR_FAILED_HANDLED: Operation failed and a helper program has already interacted with the user. Do not display any error dialog.
* @G_IO_ERROR_FAILED_HANDLED: Operation failed and a helper program has
* already interacted with the user. Do not display any error dialog.
* @G_IO_ERROR_TOO_MANY_OPEN_FILES: The current process has too many files
* open and can't open any more. Duplicate descriptors do count toward
* this limit. Since 2.20
*
* Error codes returned by GIO functions.
*
@ -364,7 +368,8 @@ typedef enum {
G_IO_ERROR_WOULD_BLOCK,
G_IO_ERROR_HOST_NOT_FOUND,
G_IO_ERROR_WOULD_MERGE,
G_IO_ERROR_FAILED_HANDLED
G_IO_ERROR_FAILED_HANDLED,
G_IO_ERROR_TOO_MANY_OPEN_FILES
} GIOErrorEnum;

View File

@ -167,7 +167,13 @@ g_io_error_from_errno (gint err_no)
return G_IO_ERROR_WOULD_BLOCK;
break;
#endif
#ifdef EMFILE
case EMFILE:
return G_IO_ERROR_TOO_MANY_OPEN_FILES;
break;
#endif
default:
return G_IO_ERROR_FAILED;
break;

View File

@ -176,6 +176,9 @@ convert_file_to_io_error (GError **error,
case G_FILE_ERROR_NOTDIR:
new_code = G_IO_ERROR_NOT_DIRECTORY;
break;
case G_FILE_ERROR_MFILE:
new_code = G_IO_ERROR_TOO_MANY_OPEN_FILES;
break;
default:
break;
}