Re: Fix netbsd32's getfh()

2014-06-28 Thread Maxime Villard
Le 26/06/2014 20:46, Christos Zoulas a écrit : On Jun 26, 4:30pm, m...@m00nbsd.net (Maxime Villard) wrote: -- Subject: Re: Fix netbsd32's getfh() | I guess it's ok now? Yes, that looks fine. But why: if (error != 0) instead of: if (error) I think that most code

Re: Fix netbsd32's getfh()

2014-06-26 Thread Maxime Villard
Le 26/06/2014 04:04, Christos Zoulas a écrit : On Jun 26, 11:30am, m...@eterna.com.au (matthew green) wrote: -- Subject: re: Fix netbsd32's getfh() | | Christos Zoulas writes: | Well, let's not propagate the evil design! I is is one thing having: | |void *p = malloc(n); |free

Re: Fix netbsd32's getfh()

2014-06-26 Thread Christos Zoulas
On Jun 26, 4:30pm, m...@m00nbsd.net (Maxime Villard) wrote: -- Subject: Re: Fix netbsd32's getfh() | I guess it's ok now? Yes, that looks fine. But why: if (error != 0) instead of: if (error) I think that most code in the tree uses the second form. christos | | Index

Re: Fix netbsd32's getfh()

2014-06-25 Thread Christos Zoulas
In article 53aa91a3.1070...@m00nbsd.net, Maxime Villard m...@m00nbsd.net wrote: Hi, Here is a patch to sync netbsd32 with the native getfh() syscall. In addition to making it consistent, it also: a) fixes the return value: } else if (error == E2BIG) { error

Re: Fix netbsd32's getfh()

2014-06-25 Thread Maxime Villard
Le 25/06/2014 17:28, Christos Zoulas a écrit : In article 53aa91a3.1070...@m00nbsd.net, Maxime Villard m...@m00nbsd.net wrote: Hi, Here is a patch to sync netbsd32 with the native getfh() syscall. In addition to making it consistent, it also: a) fixes the return value: } else

Re: Fix netbsd32's getfh()

2014-06-25 Thread Christos Zoulas
In article 53ab0471.4080...@m00nbsd.net, Maxime Villard m...@m00nbsd.net wrote: That should probably be: return error; since vfs_composefh_alloc() failed, and we should not be calling vfs_composefh_free(). Yes, but no. Actually, vfs_composefh_free() handles NULL

re: Fix netbsd32's getfh()

2014-06-25 Thread matthew green
Christos Zoulas writes: Well, let's not propagate the evil design! I is is one thing having: void *p = malloc(n); free(p); where you know p is going to be NULL when it fails and another having: foo *p; error = allocate_foo(p); free_foo(p); and expect

re: Fix netbsd32's getfh()

2014-06-25 Thread Christos Zoulas
On Jun 26, 11:30am, m...@eterna.com.au (matthew green) wrote: -- Subject: re: Fix netbsd32's getfh() | | Christos Zoulas writes: | Well, let's not propagate the evil design! I is is one thing having: | | void *p = malloc(n); | free(p); | | where you know p is going to be NULL