From cc62363ea73e4b268dc6e45810fba56941ea8c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 29 Oct 2017 21:32:07 +0100 Subject: Update sterm --- ...0002-Print-more-descriptive-error-message.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 net-dialup/sterm/files/0002-Print-more-descriptive-error-message.patch (limited to 'net-dialup/sterm/files/0002-Print-more-descriptive-error-message.patch') diff --git a/net-dialup/sterm/files/0002-Print-more-descriptive-error-message.patch b/net-dialup/sterm/files/0002-Print-more-descriptive-error-message.patch new file mode 100644 index 0000000..46c4a98 --- /dev/null +++ b/net-dialup/sterm/files/0002-Print-more-descriptive-error-message.patch @@ -0,0 +1,46 @@ +From 613b8407347b063320ebf408d06bb120293c6c3a Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Thu, 4 May 2017 00:00:10 +0200 +Subject: [PATCH 2/3] Print more descriptive error message + +--- + sterm.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sterm.c b/sterm.c +index b375caf..ea86573 100644 +--- a/sterm.c ++++ b/sterm.c +@@ -31,6 +31,7 @@ + + #define _BSD_SOURCE + #define _DEFAULT_SOURCE ++#define _GNU_SOURCE + #include + #include + #include +@@ -44,6 +45,7 @@ + #include + #include + #include ++#include + + #define STRINGIFY(val) #val + #define TOSTRING(val) STRINGIFY(val) +@@ -269,7 +271,12 @@ int main(int argc, char *argv[]) + fprintf(stderr, "%s is used by PID %d\n", dev, pid); + exit(1); + } else if (pid < 0) { +- perror("dev_lock()"); ++ char *msg; ++ asprintf(&msg, "dev_lock('%s')", dev); /* No free() because we exit() immediately */ ++ if (errno) ++ perror(msg); ++ else ++ fprintf(stderr, "%s: Error\n", msg); + exit(1); + } + atexit(unlock); +-- +2.13.6 + -- cgit v1.2.3