[haiku-commits] Re: r34091 - in haiku/trunk: headers/compatibility/bsd/sys src/libs/bsd

bga@xxxxxxxxxxxxx wrote:
> - This is my first attempt at adding something for compatibility 
> reasons. Let
>   me know if something in wrong.

Only coding style issues:

> +++ haiku/trunk/headers/compatibility/bsd/sys/wait.h  2009-11-17 15:
> 53:17 UTC (rev 34091)
> +#include_next <sys/wait.h>
> +
> +#include <sys/resource.h>
> +
> +#ifdef __cplusplus

Two blank lines between include and the next section.

> +pid_t
> +wait3(int *status, int options, struct rusage *rusage) {
> +  return wait4(-1, status, options, rusage);
> +}
> +
> +
> +pid_t
> +wait4(pid_t pid, int *status, int options, struct rusage *rusage) {

Opening curly braces go to the next line for functions.

And also:

> -  getrusage(RUSAGE_CHILDREN, rusage);
> +  if (waitPid != -1) {
> +     getrusage(RUSAGE_CHILDREN, rusage);
> +  }

Don't use blocks when they aren't needed (ie. for single line 
statements).

Bye,
   Axel.


Other related posts: