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

Re: [OT] Un code retour bizarre....



    bonjour à toutes et à tous  ;-)

On Sat, Dec 08, 2001 at 05:42:36AM +0100, bda@free.fr wrote:
> J'ai programme C qui me renvoi un code retour 139 pendant ses traitements, hors 
> je ne sais pas à quoi correspondt ce code retour, si quelqu'un peut me donner 
> la marche à suivre ou connait deja la raison, merci de m'aider.

$ man return
BASH_BUILTINS(1)                                 BASH_BUILTINS(1)
[...]
       return [n]
              Causes a function to exit  with  the  return  value
              specified by n.  If n is omitted, the return status
              is that of the last command executed in  the  func­
              tion  body.  If used outside a function, but during
              execution of a script by the .   (source)  command,
              it  causes  the shell to stop executing that script
              and return either n or the exit status of the  last
              command executed within the script as the exit sta­
              tus of the script.  If used outside a function  and
              not  during  execution of a script by ., the return
              status is false.

  ok, c'est pour le shell ; mais... c'est valable en général.

La «convention» voudrait qu'un programme retourne 'faux' en cas
d'erreur. Tout dépend maintenant de comment est codé 'faux' : il
y a souvent beaucoup de raisons possibles qui peuvent provoquer
une erreur et en général, on retourne des messages d'erreur (en texte)
compréhensibles en lieu et place des codes.
Donc, il te reste à regarder dans la doc du prog ce qui est dit
au sujet des codes d'erreur ; et sinon,
à chercher directement dans le code C  :-)

> PS:Prochain projet, je choisirai debian :-)

  c'est un problème de bonne programmation/documentation,
pas de système d'exploitation !

    bon we  :-))
-- 
Philippe BOURCIER  http://bourcier.philippe.online.fr



Reply to: