Skip to content
Open
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
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ AC_CHECK_HEADERS([uuid/uuid.h], [], [Need uuid-dev])
AC_CHECK_HEADERS([libaio.h], [], [Need libaio-dev])
AC_CHECK_HEADERS([limits.h], [], [AC_MSG_ERROR([cannot find limits.h])])
AC_CHECK_HEADERS([time.h], [], [AC_MSG_ERROR([cannot find time.h])])
AC_CHECK_HEADERS([cmocka.h], [], [AC_MSG_ERROR([cannot find cmocka.h])], [[#include <stddef.h>
#include <stdarg.h>
#include <setjmp.h>]])
AC_CHECK_HEADERS([xen/xen.h], [], [AC_MSG_ERROR([cannot find xen/xen.h])])

AC_ARG_WITH([libiconv],
[AS_HELP_STRING([--with-libiconv],
Expand Down
6 changes: 1 addition & 5 deletions drivers/atomicio.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
* ensure all of data on socket comes through. f==read || f==vwrite
*/
size_t
atomicio(f, fd, _s, n)
ssize_t (*f) (int, void *, size_t);
int fd;
void *_s;
size_t n;
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
{
char *s = _s;
size_t pos = 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/libaio-backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

#ifndef LIBAIO_BACKEND_H
#define LIBAIO_BACLEND_H
#define LIBAIO_BACKEND_H

#include <libaio.h>

Expand All @@ -43,4 +43,4 @@ enum {

struct backend* get_libaio_backend();

#endif /* LIBAIO_BACLEND_H */
#endif /* LIBAIO_BACKEND_H */
2 changes: 1 addition & 1 deletion drivers/td-blkif.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ struct td_xenblkif {

struct {
/**
* Pointer to he pending barrier request.
* Pointer to the pending barrier request.
*/
blkif_request_t *msg;

Expand Down
18 changes: 12 additions & 6 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

#ifndef __TAPDISK_UTIL_H__
#define __TAPDISK_UTIL_H_
#define __TAPDISK_UTIL_H__

#include <stddef.h>
#include <string.h>
Expand All @@ -39,14 +39,20 @@
/*
* Strncpy variant that guarantees to terminate the string
*/
static inline char *
static inline void
safe_strncpy(char *dest, const char *src, size_t n)
{
char *pdest;
pdest = strncpy(dest, src, n - 1);
if (n > 0)
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
if (n > 0) {
strncpy(dest, src, n - 1);
dest[n - 1] = '\0';
return pdest;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}

#endif /* __TAPDISK_UTIL_H__ */
6 changes: 1 addition & 5 deletions vhd/lib/atomicio.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
* ensure all of data on socket comes through. f==read || f==vwrite
*/
size_t
atomicio(f, fd, _s, n)
ssize_t (*f) (int, void *, size_t);
int fd;
void *_s;
size_t n;
atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
{
char *s = _s;
size_t pos = 0;
Expand Down