tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: prop_dictionary_internalize_from_file help



    Date:        Wed, 16 Dec 2009 08:42:17 +0100
    From:        Adam Hamsik <haaaad%gmail.com@localhost>
    Message-ID:  <C87E5C4C-BB9A-46C6-A890-38AEEF788C8A%gmail.com@localhost>

  | I barely remember that prop_dictionary_internalize_from_file returns
  | bad error when it can't parse eternalized dictionary.

The man page doesn't say that errno means anything when the proplib
functions return, which generally means that it doesn't, hence
using perror() (or strerror()) will just lead to confusion.

(And the source code supports the theory that returning anything
sensible in errno is not intended).

That function returns NULL to indicate "something went wrong", it
seems to be left to the coder/user to guess which of many possible
problems actually ocurred (which can be from opening the file, parsing
it, malloc() failure, ...)

kre



Home | Main Index | Thread Index | Old Index