Handle ENAMETOOLONG.

g_strerror doesn't appear to handle ENAMETOOLONG. Check for it ourselves.

Change-Id: Icd113a81e8d95bb3c84c91bb420a1a6a19bf5d40
Reviewed-on: https://code.wireshark.org/review/16041
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Gerald Combs 2016-06-20 09:41:10 -07:00 committed by Michael Mann
parent be303c20e5
commit d9fb7f9a5e
1 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,7 @@
#include <wsutil/report_err.h>
#include <wsutil/privileges.h>
#include <wsutil/file_util.h>
#include <wsutil/utf8_entities.h>
#include <wiretap/wtap.h> /* for WTAP_ERR_SHORT_WRITE */
@ -1864,6 +1865,13 @@ file_open_error_message(int err, gboolean for_writing)
errmsg = "The file \"%s\" could not be created because an invalid filename was specified.";
break;
#ifdef ENAMETOOLONG
case ENAMETOOLONG:
/* XXX Make sure we truncate on a character boundary. */
errmsg = "The file name \"%.80s" UTF8_HORIZONTAL_ELLIPSIS "\" is too long.";
break;
#endif
case ENOMEM:
/*
* The problem probably has nothing to do with how much RAM the