Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor cleanup

  • Loading branch information...
commit 8afa967d3960ab00abb69a2c547841ee1c51a3a1 1 parent 4928a68
@msantos authored
Showing with 5 additions and 5 deletions.
  1. +2 −2 c_src/serctl.c
  2. +3 −3 c_src/serctl.h
View
4 c_src/serctl.c
@@ -130,7 +130,7 @@ nif_read(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
if (!enif_alloc_binary(len, &buf))
return error_tuple(env, ENOMEM);
- if ( (bufsz = read(sp->fd, buf.data, buf.size)) == -1) {
+ if ( (bufsz = read(sp->fd, buf.data, buf.size)) < 0) {
int err = errno;
enif_release_binary(&buf);
return error_tuple(env, err);
@@ -157,7 +157,7 @@ nif_write(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
if (!enif_inspect_binary(env, argv[1], &buf))
return enif_make_badarg(env);
- if (write(sp->fd, buf.data, buf.size) == -1)
+ if (write(sp->fd, buf.data, buf.size) < 0)
return error_tuple(env, errno);
return atom_ok;
View
6 c_src/serctl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Michael Santos <michael.santos@gmail.com>
+ * Copyright (c) 2011-2012, Michael Santos <michael.santos@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,8 +45,8 @@
#define SRLY_VERSION "0.01"
struct SERCTL_DEF {
- const char *key;
- u_int32_t val;
+ const char *key;
+ u_int32_t val;
};
const struct SERCTL_DEF serctl_const[] = {
Please sign in to comment.
Something went wrong with that request. Please try again.