[MPlayer-cvslog] r37756 - trunk/libvo/vo_aa.c

reimar subversion at mplayerhq.hu
Sat Feb 20 12:23:46 CET 2016


Author: reimar
Date: Sat Feb 20 12:23:46 2016
New Revision: 37756

Log:
vo_aa: remove pointless dup and fileno calls.

Also fixes Coverity warnings due to not checking
for errors.

Modified:
   trunk/libvo/vo_aa.c

Modified: trunk/libvo/vo_aa.c
==============================================================================
--- trunk/libvo/vo_aa.c	Sat Feb 20 12:23:45 2016	(r37755)
+++ trunk/libvo/vo_aa.c	Sat Feb 20 12:23:46 2016	(r37756)
@@ -682,17 +682,15 @@ static int preinit(const char *arg)
 	struct stat sbuf;
 	char fname[12];
 	FILE *fp = NULL;
-	int fd, vt;
+	int vt;
 	/* check /dev/vcsa<vt> */
 	/* check only, if no driver is explicit set */
-	fd = dup (fileno (stderr));
-	if (fstat (fd, &sbuf) != -1) {
+	if (fstat (2, &sbuf) != -1) {
 	// vt number stored in device minor
 	vt = sbuf.st_rdev & 0xff;
 	sprintf (fname, "/dev/vcsa%2.2i", vt);
 	fp = fopen (fname, "w+");
 	}
-	close (fd);
 	if (fp==NULL){
 	    fprintf(stderr,"VO: [aa] cannot open %s for writing,"
 			"so we'll not use linux driver\n", fname);


More information about the MPlayer-cvslog mailing list