]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - shared/util.c
shared/util.c: assert_cc() can only be used inside functions
[thirdparty/kmod.git] / shared / util.c
index 9de080aabb18db3fd46dccc84f3e0e61e10df47c..fd2028df5a603007ee4233f2bdf850c6e4224e6d 100644 (file)
@@ -49,8 +49,6 @@ static const struct kmod_ext {
        { }
 };
 
-assert_cc(EAGAIN == EWOULDBLOCK);
-
 /* string handling functions and memory allocations                         */
 /* ************************************************************************ */
 
@@ -201,6 +199,8 @@ ssize_t read_str_safe(int fd, char *buf, size_t buflen)
        size_t todo = buflen - 1;
        size_t done = 0;
 
+       assert_cc(EAGAIN == EWOULDBLOCK);
+
        do {
                ssize_t r = read(fd, buf + done, todo);
 
@@ -226,6 +226,8 @@ ssize_t write_str_safe(int fd, const char *buf, size_t buflen)
        size_t todo = buflen;
        size_t done = 0;
 
+       assert_cc(EAGAIN == EWOULDBLOCK);
+
        do {
                ssize_t r = write(fd, buf + done, todo);