min() and max() macros belong to utils.h. They should also be lower
case, just like the rest of the world tends to have them.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
}
/* The data from OWNET_read appears to not be NULL terminated */
}
/* The data from OWNET_read appears to not be NULL terminated */
- memcpy(buf, tmp, MIN(ret, sizeof(buf) -1));
+ memcpy(buf, tmp, min(ret, sizeof(buf) -1));
#include "process.h"
#include "debug.h"
#include "process.h"
#include "debug.h"
static int epoll_fd;
static unsigned int max_jobs;
static int epoll_fd;
static unsigned int max_jobs;
* Forks a child and executes a command to run on parallel
*/
* Forks a child and executes a command to run on parallel
*/
-#define max(a,b) (a) < (b) ? (b) : (a)
#define BUF_SIZE (128*1024)
int run(const char *cmd, char *const argv[])
{
#define BUF_SIZE (128*1024)
int run(const char *cmd, char *const argv[])
{
#ifndef _UTILS_H_
#define _UTILS_H_
#ifndef _UTILS_H_
#define _UTILS_H_
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#define max(a,b) (a) < (b) ? (b) : (a)
#define ARRAY_SIZE(a) (sizeof(a) / (sizeof((a)[0])))
#define ARRAY_SIZE(a) (sizeof(a) / (sizeof((a)[0])))