diff --git a/gio/ChangeLog b/gio/ChangeLog index af649eea1..cdd102888 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,15 @@ +2009-01-07 Matthias Clasen + + 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 * === Released 2.19.4 === diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 017eda7d9..2ea2e8111 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -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 gio-unix-2.0.pc pkg-config - * file when using it. + * Note that <gio/gdesktopappinfo.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. */ #define DEFAULT_APPLICATIONS_GROUP "Default Applications" diff --git a/gio/gioenums.h b/gio/gioenums.h index 93ac55756..2b69ccf56 100644 --- a/gio/gioenums.h +++ b/gio/gioenums.h @@ -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; diff --git a/gio/gioerror.c b/gio/gioerror.c index f06e0cf20..22d424ba5 100644 --- a/gio/gioerror.c +++ b/gio/gioerror.c @@ -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; diff --git a/gio/glocalfileenumerator.c b/gio/glocalfileenumerator.c index 664a44a1f..eda7b034a 100644 --- a/gio/glocalfileenumerator.c +++ b/gio/glocalfileenumerator.c @@ -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; }