chiark / gitweb /
io-util: add an unlikely decorator for a test that should never hold
authorLennart Poettering <lennart@poettering.net>
Mon, 19 Feb 2018 17:37:50 +0000 (18:37 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:59:00 +0000 (07:59 +0200)
src/basic/io-util.c

index 08ad42ed952468df310df00972cdecb3a051bfb5..a6e34cb76256716cdce66dece41dda65d11ad7a0 100644 (file)
@@ -137,7 +137,7 @@ int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
         assert(fd >= 0);
         assert(buf);
 
-        if (nbytes > (size_t) SSIZE_MAX)
+        if (_unlikely_(nbytes > (size_t) SSIZE_MAX))
                 return -EINVAL;
 
         do {