[MPlayer-cvslog] r32462 - trunk/vidix/mtrr.c
reimar
subversion at mplayerhq.hu
Sat Oct 9 14:07:49 CEST 2010
Author: reimar
Date: Sat Oct 9 14:07:49 2010
New Revision: 32462
Log:
Simplify code for writing to /proc/mtrr.
Modified:
trunk/vidix/mtrr.c
Modified: trunk/vidix/mtrr.c
==============================================================================
--- trunk/vidix/mtrr.c Sat Oct 9 13:45:45 2010 (r32461)
+++ trunk/vidix/mtrr.c Sat Oct 9 14:07:49 2010 (r32462)
@@ -54,13 +54,9 @@ int mtrr_set_type(unsigned base,unsigned
mtrr_fd = fopen("/proc/mtrr","wt");
if(mtrr_fd)
{
- char sout[256];
- unsigned wr_len;
- sprintf(sout,"base=0x%08X size=0x%08X type=%s\n",base,size,stype);
- wr_len = fprintf(mtrr_fd,sout);
- /*printf("MTRR: %s\n",sout);*/
+ int wr_len = fprintf(mtrr_fd, "base=0x%08X size=0x%08X type=%s\n", base, size, stype);
fclose(mtrr_fd);
- return wr_len == strlen(sout) ? 0 : EPERM;
+ return wr_len > 0 ? 0 : EPERM;
}
return ENOSYS;
#elif defined (__i386__ ) && defined (__NetBSD__) && __NetBSD_Version__ > 105240000
More information about the MPlayer-cvslog
mailing list