[haiku-commits] Re: haiku: hrev43834 - src/build/libroot headers/build/host/darwin/sys

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 09 Mar 2012 14:11:59 +0100

On 03/09/2012 05:41 AM, jscipione@xxxxxxxxx wrote:
-       diskutil info $(pwd) | grep -i "case-sensitive">  /dev/null
+       diskutil info $(pwd)/.. | grep -i "case-sensitive">  /dev/null

Out of curiosity: how is this change fixing anything?

And then a couple of coding style issues:

+++ b/headers/build/host/darwin/sys/stat.h
@@ -0,0 +1,31 @@
+#ifndef _HAIKU_BUILD_COMPATIBILITY_DARWIN_SYS_STAT
+#define _HAIKU_BUILD_COMPATIBILITY_DARWIN_SYS_STAT
+
+#include_next<sys/stat.h>

Two blank lines.

+++ b/src/build/libroot/fs_darwin.cpp
@@ -0,0 +1,659 @@
+/*
+ * Copyright 2011, John Scipione, jscipione@xxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+#include "fs_darwin.h"

Two blank lines.

+}
+
+int
+eaccess(const char* path, int accessMode)

Two blank lines.

+int
+faccessat(int fd, const char* path, int accessMode, int flag)
+{
[...]
+       char *fullPath = (char *)malloc(MAXPATHLEN);

Mix of asterisk style.

+               if (get_path(oldFD, oldPath,&oldFullPath)<  0) {
+                       free(oldFullPath);
+                       return -1;
+               }

You might want to have a look at the private/shared/AutoDeleter.h header - classes like the MemoryDeleter make this much less error prone, and easier to read, too.

+               newFullPath = (char *)malloc(MAXPATHLEN);
+               if (newFullPath == NULL) {
+                       // ran out of memory allocating newFullPath
+                       errno = ENOMEM;
+                       return -1;

For example, here you don't free oldFullPath.

@@ -0,0 +1,41 @@
+/*
+ * Copyright 2011, John Scipione, jscipione@xxxxxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef FS_DARWIN_H
+#define FS_DARWIN_H
+
+/*

Two blank lines, and it's 2012 already :-)

+int futimesat(int fd, const char *path, const struct timeval times[2]);
+
+#endif // FS_DARWIN_H

Two blank lines.

Bye,
   Axel.

Other related posts: