Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@ else
conf.set('fallthrough', 'do {} while (0) /* fallthrough */')
endif

if cc.has_function('TEMP_FAILURE_RETRY', prefix : '#include <errno.h>')
conf.set('TFR', 'TEMP_FAILURE_RETRY')
else
conf.set('TFR(exp)', ''' \
({ \
long int __result = 0; \
do { \
__result = (long int)(exp); \
} while ((__result == -1) && (errno == EINTR)); \
__result; \
})
''')
endif

configure_file(
output: 'config.h',
configuration: conf
Expand Down
5 changes: 3 additions & 2 deletions util/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <sys/syslog.h>
#include <sys/time.h>
#include <linux/types.h>
#include <errno.h>

#include <libnvme.h>

Expand Down Expand Up @@ -96,7 +97,7 @@ int nvme_submit_passthru(int fd, unsigned long ioctl_cmd,
if (log_level >= LOG_DEBUG)
gettimeofday(&start, NULL);

err = ioctl(fd, ioctl_cmd, cmd);
err = TFR(ioctl(fd, ioctl_cmd, cmd));

if (log_level >= LOG_DEBUG) {
gettimeofday(&end, NULL);
Expand All @@ -122,7 +123,7 @@ int nvme_submit_passthru64(int fd, unsigned long ioctl_cmd,
gettimeofday(&start, NULL);


err = ioctl(fd, ioctl_cmd, cmd);
err = TFR(ioctl(fd, ioctl_cmd, cmd));

if (log_level >= LOG_DEBUG) {
gettimeofday(&end, NULL);
Expand Down