Skip to content

Commit

Permalink
include/common.h, common/common.c, clients/upsclient.c: fix select_re…
Browse files Browse the repository at this point in the history
…ad()/select_write(): long d_usec => suseconds_t
  • Loading branch information
jimklimov committed Nov 26, 2021
1 parent ddc0f4e commit a40a8c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions clients/upsclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ const char *upscli_strerror(UPSCONN_t *ups)
/* Read up to buflen bytes from fd and return the number of bytes
read. If no data is available within d_sec + d_usec, return 0.
On error, a value < 0 is returned (errno indicates error). */
static ssize_t upscli_select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const long d_usec)
static ssize_t upscli_select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec)
{
ssize_t ret;
fd_set fds;
Expand Down Expand Up @@ -682,7 +682,7 @@ static ssize_t net_read(UPSCONN_t *ups, char *buf, size_t buflen, const long tim
/* Write up to buflen bytes to fd and return the number of bytes
written. If no data is available within d_sec + d_usec, return 0.
On error, a value < 0 is returned (errno indicates error). */
static ssize_t upscli_select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const long d_usec)
static ssize_t upscli_select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec)
{
ssize_t ret;
fd_set fds;
Expand Down
4 changes: 2 additions & 2 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ char *xstrdup(const char *string)
/* Read up to buflen bytes from fd and return the number of bytes
read. If no data is available within d_sec + d_usec, return 0.
On error, a value < 0 is returned (errno indicates error). */
ssize_t select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const long d_usec)
ssize_t select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec)
{
int ret;
fd_set fds;
Expand All @@ -844,7 +844,7 @@ ssize_t select_read(const int fd, void *buf, const size_t buflen, const long d_s
/* Write up to buflen bytes to fd and return the number of bytes
written. If no data is available within d_sec + d_usec, return 0.
On error, a value < 0 is returned (errno indicates error). */
ssize_t select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const long d_usec)
ssize_t select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec)
{
int ret;
fd_set fds;
Expand Down
4 changes: 2 additions & 2 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ void *xcalloc(size_t number, size_t size);
void *xrealloc(void *ptr, size_t size);
char *xstrdup(const char *string);

ssize_t select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const long d_usec);
ssize_t select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const long d_usec);
ssize_t select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec);
ssize_t select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const suseconds_t d_usec);

char * get_libname(const char* base_libname);

Expand Down

0 comments on commit a40a8c8

Please sign in to comment.