From 77f4d19adf137912fb0cbccaec6d3d663adbeb0e Mon Sep 17 00:00:00 2001 From: nick Date: Sun, 3 Feb 2002 09:29:35 +0000 Subject: Be more precise git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4496 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libdha/mtrr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libdha/mtrr.c') diff --git a/libdha/mtrr.c b/libdha/mtrr.c index 4373b0f808..8a8e9b2e51 100644 --- a/libdha/mtrr.c +++ b/libdha/mtrr.c @@ -31,18 +31,23 @@ int mtrr_set_type(unsigned base,unsigned size,int type) mtrr_fd = fopen("/proc/mtrr","wt"); if(mtrr_fd) { - fprintf(mtrr_fd,"base=0x%08X size=0x%08X type=%s\n",base,size,stype); - printf("base=0x%08X size=0x%08X type=%s\n",base,size,stype); + 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);*/ fclose(mtrr_fd); - return 0; + return wr_len == strlen(sout) ? 0 : EPERM; } return ENOSYS; #else #warning Please port MTRR stuff!!! + return ENOSYS #endif } #else int mtrr_set_type(unsigned base,unsigned size,int type) { + return ENOSYS; } #endif \ No newline at end of file -- cgit v1.2.3