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

Bug#1062122: libtrash_3.9.0-2: Corrections to return_function_error()



Review by original author, M. Arriaga exposed a couple of errors in the calling of return_function_error().

The original Macro implementation involved a call with parameter err but the function implementation passed the parameter function. Now, err is set within the calling frame.

From v3.8

#define RETURN_FUNCTION_ERROR(err) \
{ \
        FdOrFp retval; \
        if (function == FOPEN || function == FREOPEN ||                                 \                         function == FOPEN64 || function == FREOPEN64)                   \
        retval.fp = NULL; \
        else /* if (function == OPEN || function == OPEN64)*/                           \
        retval.fd = -1; \
        errno = err; \
        return retval; /* the caller will know which member of the union to access */   \
}

v3.9-2

FdOrFp return_function_error(int function)
{ \
        FdOrFp retval;
        if (function == FOPEN || function == FREOPEN || function == FOPEN64 || function == FREOPEN64)
                retval.fp = NULL;
        else            /* if (function == OPEN || function == OPEN64)*/
                retval.fd = -1;
        return retval;  /* the caller will know which member of the union to access */
}

--
Peter Hyman

Attachment: libtrash_3.9.0-2_amd64.deb
Description: application/vnd.debian.binary-package

Attachment: v3.9.0-2.diff.gz
Description: application/gzip


Reply to: