Re: [PATCH 3/6] Change fprintf(stderr,...) to perror()

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

 



Gustavo F. Padovan wrote:
> 
> @@ -1922,7 +1922,7 @@ static void cmd_lst(int dev_id, int argc, char **argv)
>  	if (dev_id < 0) {
>  		dev_id = hci_for_each_dev(HCI_UP, find_conn, (long) &bdaddr);
>  		if (dev_id < 0) {
> -			fprintf(stderr, "Not connected.\n");
> +			perror("Not connected.");
>  			exit(1);
>  		}
>  	}

You should only perror() if errno is valid for the error being reported.
 Otherwise you're going to get odd messages like:

Not connected.: Success

David
-- 
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux