[ 
https://issues.apache.org/jira/browse/YARN-2161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14145585#comment-14145585
 ] 

Allen Wittenauer commented on YARN-2161:
----------------------------------------

Looks good for the most part!  A few minor things:

{code}
+#if defined(__MACH__)
+  // only those fds are opened assuming no bug
+  fclose(LOGFILE);
+  fclose(ERRORFILE);
+  fclose(stdin);
+  fclose(stdout);
+  fclose(stderr);
+#else
   fcloseall();
+#endif
{code}

It would probably be better to detect if fcloseall is a valid function.  If 
not, then use the manual fclose.  This would allow the code to run on not just 
OS X but other systems as well.

{code}
+#if defined(__FreeBSD__) || defined(__MACH__)
+  fprintf(LOGFILE, "Failed to mount cgroup controller, not supported\n");
+  return -1;
+#else
{code}

I sort of prefer the fix from YARN-1327 here, where it does +#ifndef __linux 
instead.

{code}
+#if !defined(__MACH__) // macosx do not have user bin
   if (check_user("bin") == NULL) {
     printf("FAIL: failed check for whitelisted system user bin\n");
     exit(1);
   }
+#endif
{code}

Rather than ignore this test completely, can we chose a different user instead?

Also, can you incorporate the other changes from YARN-1327 so that we can do 
one commit?

Thanks!


> Fix build on macosx: YARN parts
> -------------------------------
>
>                 Key: YARN-2161
>                 URL: https://issues.apache.org/jira/browse/YARN-2161
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Binglin Chang
>            Assignee: Binglin Chang
>         Attachments: YARN-2161.v1.patch
>
>
> When compiling on macosx with -Pnative, there are several warning and errors, 
> fix this would help hadoop developers with macosx env. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to