From: Simon Ruderich Date: Mon, 10 Jun 2019 20:14:50 +0000 (+0200) Subject: nss: simplify initialization of struct file in map_file() X-Git-Tag: 0.1~77 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=0d99032f2a22b97cd7c49bfba4a6cd0b41fd87d6;hp=0d99032f2a22b97cd7c49bfba4a6cd0b41fd87d6;p=nsscash%2Fnsscash.git nss: simplify initialization of struct file in map_file() It's not necessary to initialize ->fd at the beginning of map_file() as the call to open(2) will overwrite it anyway. Also adapt a check for a valid file descriptor. Although POSIX states that open(2) returns -1 on error, there is no reason to hard-code this constant. Instead, check for any negative value. ---