PERFORCE change 162932 for review

Sylvestre Gallon syl at FreeBSD.org
Thu May 28 08:29:11 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=162932

Change 162932 by syl at syl_rincewind on 2009/05/28 08:28:26

	Use fprintf(stderr, ...) for error messages.

Affected files ...

.. //depot/projects/soc2009/syl_usb/libusb-tests/descriptors/test1/test1.c#2 edit

Differences ...

==== //depot/projects/soc2009/syl_usb/libusb-tests/descriptors/test1/test1.c#2 (text+ko) ====

@@ -13,7 +13,7 @@
 	int ret;
 	int i;
 
-	printf("This function will print out all the device"
+	printf("This program will print out all the device"
 	    " descriptors for all the present devices.\n");
 
 	ddesc = malloc(sizeof(libusb_device_descriptor));
@@ -23,18 +23,18 @@
 	}
 
 	if (libusb_init(&ctx) != 0) {
-		printf("libusb_init failed\n");
+		fprintf(stderr, "libusb_init failed\n");
 		return (EXIT_FAILURE);
 	}
 
 	if ((ret = libusb_get_device_list(ctx, &devs_list)) < 0) {
-		printf("libusb_get_device_list failed with 0x%x error code\n",
+		fprintf(stderr,"libusb_get_device_list failed with 0x%x error code\n",
 		    ret);
 		return (EXIT_FAILURE);
 	}
 	
 	if (ret == 0) {
-		printf("No device match or lack of permissions.\n");
+		fprintf(stderr, "No device match or lack of permissions.\n");
 		return (EXIT_SUCCESS);
 	}
 	printf("\nThere are %i devices\n\n", ret);


More information about the p4-projects mailing list