Commit ed718e60 authored by Federico Vaga's avatar Federico Vaga

lib: control return value for errors

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 9d05fc43
......@@ -248,6 +248,8 @@ struct trtl_dev *trtl_open_by_lun(unsigned int lun)
return NULL;
}
ret = readlink(path, dev_id_str, sizeof(dev_id_str));
if (ret < 0)
return NULL;
if (sscanf(dev_id_str, "%4x", &dev_id) != 1) {
errno = ENODEV;
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment