Репозитории ALT
S: | 3.2p1.4-alt13 |
5.1: | 3.2p1.4-alt7 |
3.0: | |
+backports: | 3.2p1.4-alt2.M30.3 |
Группа :: Система/Библиотеки
Пакет: libxview
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: xview_3.2p1.4-alt-sys_errlist.patch
Скачать
Скачать
diff -ru xview-3.2p1.4-orig/lib/libxview/base/xv_error.c xview-3.2p1.4/lib/libxview/base/xv_error.c
--- xview-3.2p1.4-orig/lib/libxview/base/xv_error.c 2020-12-26 22:48:06.846106112 +0200
+++ xview-3.2p1.4/lib/libxview/base/xv_error.c 2020-12-26 23:23:10.372123393 +0200
@@ -21,8 +21,6 @@
#include <errno.h>
#else
/* Unix system error variables */
-extern int sys_nerr;
-extern char *sys_errlist[];
extern int errno;
#endif
@@ -117,11 +115,7 @@
switch (layer) {
case ERROR_SYSTEM:
layer_name = XV_MSG("System");
- if ((int) errno < sys_nerr)
- sprintf(layer_msg, "%s", sys_errlist[(int) errno]);
- else
- sprintf(layer_msg, XV_MSG("unix error %d"),
- (int) errno);
+ sprintf(layer_msg, "%s", strerror(errno));
break;
case ERROR_SERVER:
layer_name = XV_MSG("Server");
diff -ru xview-3.2p1.4-orig/lib/libxview/textsw/es_file.c xview-3.2p1.4/lib/libxview/textsw/es_file.c
--- xview-3.2p1.4-orig/lib/libxview/textsw/es_file.c 2020-12-26 22:48:06.853105952 +0200
+++ xview-3.2p1.4/lib/libxview/textsw/es_file.c 2020-12-26 23:24:55.081735286 +0200
@@ -116,8 +116,7 @@
/* martin.buck@bigfoot.com */
#include <errno.h>
#else
-extern int errno, sys_nerr;
-extern char *sys_errlist[];
+extern int errno;
#endif
static void update_read_buf(); /* update the read buf if overlaps write buf */
@@ -290,7 +289,7 @@
(void) strcat(error_buf, XV_MSG("alloc failure"));
break;
default:
- if (errno <= 0 || errno >= sys_nerr)
+ if (errno <= 0)
goto Default;
(void) sprintf(first_free_in_buf,
#ifdef OW_I18N
@@ -298,7 +297,7 @@
#else
XV_MSG("file '%s': %s"),
#endif
- file_name, sys_errlist[errno]);
+ file_name, strerror(errno));
break;
}
break;
diff -ru xview-3.2p1.4-orig/lib/libxview/textsw/txt_file.c xview-3.2p1.4/lib/libxview/textsw/txt_file.c
--- xview-3.2p1.4-orig/lib/libxview/textsw/txt_file.c 2020-12-26 22:48:06.855105907 +0200
+++ xview-3.2p1.4/lib/libxview/textsw/txt_file.c 2020-12-26 23:36:37.918705277 +0200
@@ -57,8 +57,7 @@
/* martin.buck@bigfoot.com */
#include <errno.h>
#else
-extern int errno, sys_nerr;
-extern char *sys_errlist[];
+extern int errno;
#endif
Pkg_private int textsw_change_directory();
@@ -1109,7 +1108,7 @@
XV_MSG("Unable to Include File."));
notice_msg2 = XV_MSG("An INTERNAL ERROR has occurred.");
}
- sys_msg = (errno > 0 && errno < sys_nerr) ? sys_errlist[errno] : NULL;
+ sys_msg = (errno > 0) ? strerror(errno) : NULL;
frame = (Frame)FRAME_FROM_FOLIO_OR_VIEW(view);
text_notice = (Xv_Notice)xv_get(frame,
@@ -1211,7 +1210,7 @@
XV_MSG("Unable to Include File."));
notice_msg2 = XV_MSG("An INTERNAL ERROR has occurred.");
}
- sys_msg = (errno > 0 && errno < sys_nerr) ? sys_errlist[errno] : NULL;
+ sys_msg = (errno > 0) ? strerror(errno) : NULL;
frame = FRAME_FROM_FOLIO_OR_VIEW(view);
text_notice = (Xv_Notice)xv_get(frame,
@@ -2289,7 +2288,7 @@
(might_not_be_dir ?
XV_MSG("Unable to access file") :
XV_MSG("Unable to cd to directory")));
- sys_msg = (errno > 0 && errno < sys_nerr) ? sys_errlist[errno] : NULL;
+ sys_msg = (errno > 0) ? strerror(errno) : NULL;
frame = FRAME_FROM_FOLIO_OR_VIEW(textsw);
text_notice = (Xv_Notice)xv_get(frame,
@@ -2394,7 +2393,7 @@
XV_MSG("Cannot cd to directory")),
full_pathname);
free(full_pathname);
- sys_msg = (errno > 0 && errno < sys_nerr) ? sys_errlist[errno] : NULL;
+ sys_msg = (errno > 0) ? strerror(errno) : NULL;
if (sys_msg)
strcat(err_msgs, sys_msg);
return (result);