]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
whitespace cleanup
authorPrashanth Mundkur <prashanth.mundkur@citrix.com>
Wed, 13 May 2009 17:15:53 +0000 (10:15 -0700)
committerPrashanth Mundkur <prashanth.mundkur@citrix.com>
Wed, 13 May 2009 17:39:52 +0000 (10:39 -0700)
libs/stdext/unixext_stubs.c

index 9626f6050480ac4c4c30fda7f9dd1e40698a9ee7..ca7573495ea8be6c0cf33d3e888f2aab8ffcb7f3 100644 (file)
@@ -19,7 +19,7 @@
 
 static void failwith_errno(void)
 {
-        char buf[256];
+       char buf[256];
        char buf2[280];
        memset(buf, '\0', sizeof(buf));
        //strerror_r(errno, buf, sizeof(buf));
@@ -46,7 +46,6 @@ CAMLprim value stub_unixext_fsync (value fd)
        if (fsync(c_fd) != 0) failwith_errno();
        CAMLreturn(Val_unit);
 }
-       
 
 CAMLprim value stub_unixext_get_max_fd (value unit)
 {
@@ -177,7 +176,7 @@ CAMLprim value stub_fdset_select(value rset, value wset, value eset, value t)
        memcpy(FDSET_OF_VALUE(nrset), &r, sizeof(fd_set));
        memcpy(FDSET_OF_VALUE(nwset), &w, sizeof(fd_set));
        memcpy(FDSET_OF_VALUE(neset), &e, sizeof(fd_set));
-       
+
        ret = caml_alloc_small(3, 0);
        Field(ret, 0) = nrset;
        Field(ret, 1) = nwset;
@@ -217,7 +216,7 @@ CAMLprim value stub_fdset_select_ro(value rset, value t)
 
        ret = caml_alloc(sizeof(struct fdset_t), Abstract_tag);
        memcpy(FDSET_OF_VALUE(ret), &r, sizeof(fd_set));
-       
+
        CAMLreturn(ret);
 }
 
@@ -248,19 +247,19 @@ value stub_unixext_get_major_minor(value dpath)
 
 static void caml_pthread_check(int retcode, char *msg)
 {
-  char * err;
-  int errlen, msglen;
-  value str;
-
-  if (retcode == 0) return;
-  err = strerror(retcode);
-  msglen = strlen(msg);
-  errlen = strlen(err);
-  str = alloc_string(msglen + 2 + errlen);
-  memmove (&Byte(str, 0), msg, msglen);
-  memmove (&Byte(str, msglen), ": ", 2);
-  memmove (&Byte(str, msglen + 2), err, errlen);
-  raise_sys_error(str);
+       char * err;
+       int errlen, msglen;
+       value str;
+
+       if (retcode == 0) return;
+       err = strerror(retcode);
+       msglen = strlen(msg);
+       errlen = strlen(err);
+       str = alloc_string(msglen + 2 + errlen);
+       memmove (&Byte(str, 0), msg, msglen);
+       memmove (&Byte(str, msglen), ": ", 2);
+       memmove (&Byte(str, msglen + 2), err, errlen);
+       raise_sys_error(str);
 }
 
 // from http://caml.inria.fr/mantis/view.php?id=4104
@@ -272,6 +271,7 @@ CAMLprim value caml_condition_timedwait(value v_cnd, value v_mtx, value v_timeo)
        pthread_mutex_t *mtx = Mutex_val(v_mtx);
        double timeo = Double_val(v_timeo);
        struct timespec ts;
+
        ts.tv_sec = timeo;
        ts.tv_nsec = (timeo - ts.tv_sec) * 1e9;
        enter_blocking_section();
@@ -281,4 +281,3 @@ CAMLprim value caml_condition_timedwait(value v_cnd, value v_mtx, value v_timeo)
        caml_pthread_check(ret, "Condition.timedwait");
        CAMLreturn(Val_true);
 }
-