changeset 4495:0e4cffa369e4

Be more precise
author nick
date Sun, 03 Feb 2002 09:29:35 +0000
parents 382a3c60629e
children bf7ea03b1adf
files libdha/mtrr.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libdha/mtrr.c	Sun Feb 03 09:28:58 2002 +0000
+++ b/libdha/mtrr.c	Sun Feb 03 09:29:35 2002 +0000
@@ -31,18 +31,23 @@
     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