summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-27 13:28:00 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-27 13:28:00 +0100
commit7fbf2a31d95a864b707207aae87e1eb1d6910197 (patch)
tree4bc38b6c0a7fc4522f6b09966df0c55846bea2bb
parent8dd0914484eb82dd2f8a4384ce5e631fb257ba3a (diff)
downloadtaler-mdb-7fbf2a31d95a864b707207aae87e1eb1d6910197.tar.gz
taler-mdb-7fbf2a31d95a864b707207aae87e1eb1d6910197.tar.bz2
taler-mdb-7fbf2a31d95a864b707207aae87e1eb1d6910197.zip
fix checking of syscall rvals
-rw-r--r--src/main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 48a1a49..1718ca2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1080,7 +1080,7 @@ shutdown_task (void *cls)
}
if (0 < cancel_button.cancelbuttonfd)
{
- close (cancel_button.cancelbuttonfd);
+ GNUNET_break (0 == close (cancel_button.cancelbuttonfd));
cancel_button.cancelbuttonfd = open ("/sys/class/gpio/unexport",
O_WRONLY);
if (0 > cancel_button.cancelbuttonfd)
@@ -1088,10 +1088,19 @@ shutdown_task (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Unable to open /gpio/unexport for cancel button\n");
}
- (void) ! write (cancel_button.cancelbuttonfd,
- "23",
- 2);
- close (cancel_button.cancelbuttonfd);
+ else
+ {
+ if (2 != write (cancel_button.cancelbuttonfd,
+ "23",
+ 2))
+ {
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "write",
+ "/sys/class/gpio/unexport");
+
+ }
+ GNUNET_break (0 == close (cancel_button.cancelbuttonfd));
+ }
}
/* free the allocated productes read from config file */
if (NULL != products)
@@ -1845,7 +1854,9 @@ cancel_button_pressed (void *cls)
return;
}
- lseek (cancel_button.cancelbuttonfd, 0, SEEK_SET);
+ GNUNET_break (0 == lseek (cancel_button.cancelbuttonfd,
+ 0,
+ SEEK_SET));
/* This point should only be reached when a order is pending, because
* the scheduler read file gets added in the function "launch_payment".
* But anyway safe check, else do nothing */