commit: b51da2a6cc5143174522ba123e8d05012d9d7355
parent 5ded09959903e68ef1be525d24b9670df8befcfe
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 28 Mar 2024 18:54:36 +0100
cmd/touch: assert(errno == 0)
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/cmd/touch.c b/cmd/touch.c
@@ -9,6 +9,7 @@
#include "../lib/bitmasks.h" /* FIELD_* */
#include "../lib/iso_parse.h" /* iso_parse */
+#include <assert.h>
#include <errno.h> /* errno */
#include <fcntl.h> /* open */
#include <stdbool.h> /* bool */
@@ -112,6 +113,7 @@ main(int argc, char *argv[])
for(int i = 0; i < argc; i++)
{
+ assert(errno == 0);
int fd = open(argv[i], open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if(fd == -1)
{