[Drbd-dev] avoid use of errno as a function parameter name

David Butterfield dab21774 at gmail.com
Wed Jun 5 18:14:19 CEST 2019


Avoid use of errno as an argument name because it is allowed to be a macro such as
    # define errno (*__errno_location ())

diff --git a/drbd_wrappers.h b/drbd_wrappers.h
-static inline blk_status_t errno_to_blk_status(int errno)
+static inline blk_status_t errno_to_blk_status(int _errno)
 {
        blk_status_t status =
-               errno == 0 ? BLK_STS_OK :
-               errno == -ENOMEM ? BLK_STS_RESOURCE :
-               errno == -EOPNOTSUPP ? BLK_STS_NOTSUPP :
+               _errno == 0 ? BLK_STS_OK :
+               _errno == -ENOMEM ? BLK_STS_RESOURCE :
+               _errno == -EOPNOTSUPP ? BLK_STS_NOTSUPP :
                BLK_STS_IOERR;


More information about the drbd-dev mailing list