Subject: Re: should readdisklabel be changed to return 'const char *'?
To: David Laight <david@l8s.co.uk>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 05/01/2003 19:17:42
On Thu, May 01, 2003 at 05:48:48PM +0100, David Laight wrote:
> However since almost all the returned strings are literals
> it should really be:
> 
> const char *readdisklabel(dev_t, void (*)(struct buf *),
>             struct disklabel *, struct cpu_disklabel *);

Seeing Jason fight for removing "no disk label" error messages
it should probably be

 int readdisklabel(dev_t, void (*)(struct buf *),
           struct disklabel *, struct cpu_disklabel *, const char **errorMsg);

and return -1 if no label was found, 0 if everything is OK and some error
code (plus setting *errorMsg) if something went wrong.

Martin