changeset 819:616a36d39703

error: add EEOF errno Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sun, 06 Sep 2020 23:28:12 -0400
parents 4e86cf312d6c
children fcbf39e8ae4e
files cmake/config-errno.cmake error.c include/jeffpc/config.h.in include/jeffpc/error.h io_common.h man/xread.3
diffstat 6 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/cmake/config-errno.cmake	Fri Sep 04 07:34:28 2020 -0400
+++ b/cmake/config-errno.cmake	Sun Sep 06 23:28:12 2020 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+# Copyright (c) 2018-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -42,3 +42,4 @@
 
 find_errno(ECKSUM)
 find_errno(ENOTUNIQ)
+find_errno(EEOF)
--- a/error.c	Fri Sep 04 07:34:28 2020 -0400
+++ b/error.c	Sun Sep 06 23:28:12 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2013-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -318,6 +318,8 @@
 			return "Checksum mismatch";
 		case -ENOTUNIQ:
 			return "Name, identifier, or object not unique";
+		case -EEOF:
+			return "End of file";
 	}
 
 	return strerror(-e);
--- a/include/jeffpc/config.h.in	Fri Sep 04 07:34:28 2020 -0400
+++ b/include/jeffpc/config.h.in	Sun Sep 06 23:28:12 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2016-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -46,6 +46,7 @@
 
 #cmakedefine JEFFPC_ERRNO_ECKSUM	${JEFFPC_ERRNO_ECKSUM}
 #cmakedefine JEFFPC_ERRNO_ENOTUNIQ	${JEFFPC_ERRNO_ENOTUNIQ}
+#cmakedefine JEFFPC_ERRNO_EEOF		${JEFFPC_ERRNO_EEOF}
 
 #cmakedefine JEFFPC_LOCK_TRACKING
 
--- a/include/jeffpc/error.h	Fri Sep 04 07:34:28 2020 -0400
+++ b/include/jeffpc/error.h	Sun Sep 06 23:28:12 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2013-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -41,6 +41,9 @@
 #ifdef JEFFPC_ERRNO_ENOTUNIQ
 #define ENOTUNIQ	JEFFPC_ERRNO_ENOTUNIQ
 #endif
+#ifdef JEFFPC_ERRNO_EEOF
+#define EEOF		JEFFPC_ERRNO_EEOF
+#endif
 
 #define NORETURN __attribute__((__noreturn__))
 
--- a/io_common.h	Fri Sep 04 07:34:28 2020 -0400
+++ b/io_common.h	Sun Sep 06 23:28:12 2020 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2011-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -54,7 +54,7 @@
 		}
 
 		if (ret == 0) {
-			ret = -EPIPE;
+			ret = -EEOF;
 			goto err;
 		}
 
--- a/man/xread.3	Fri Sep 04 07:34:28 2020 -0400
+++ b/man/xread.3	Sun Sep 06 23:28:12 2020 -0400
@@ -1,4 +1,4 @@
-.Dd February 13, 2020
+.Dd September 6, 2020
 .Dt XREAD 3
 .Os
 .\"
@@ -59,7 +59,7 @@
 .Xr pread 2 ,
 respectively with the following differences:
 .Bl -tag -width Er
-.It Er -EPIPE
+.It Er -EEOF
 The requested number of bytes could not be read.
 If
 .Fn xread