updated logging for seperate files for main and clone accelerant

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5909 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2004-01-05 12:57:22 +00:00
parent ccbc426cd2
commit a243b54e73
5 changed files with 41 additions and 11 deletions
@@ -4,7 +4,7 @@
Other authors:
Mark Watson,
Rudolf Cornelissen 10/2002-12/2003.
Rudolf Cornelissen 10/2002-1/2004.
*/
#define MODULE_BIT 0x00800000
@@ -254,7 +254,18 @@ status_t CLONE_ACCELERANT(void *data) {
strcat(path, (const char *)data);
/* open the device, the permissions aren't important */
fd = open(path, B_READ_WRITE);
if (fd < 0) {
if (fd < 0)
{
/* we can't use LOG because we didn't get the shared_info struct.. */
char fname[64];
FILE *myhand = NULL;
sprintf (fname, "/boot/home/" DRIVER_PREFIX ".accelerant.0.log");
myhand=fopen(fname,"a+");
fprintf(myhand, "CLONE_ACCELERANT: couldn't open kerneldriver %s! Aborting.\n", path);
fclose(myhand);
/* abort with resultcode from open attempt on kerneldriver */
result = fd;
goto error0;
}
@@ -3,7 +3,7 @@
This file may be used under the terms of the Be Sample Code License.
Other authors for nm driver:
Rudolf Cornelissen 4/2003-6/2003
Rudolf Cornelissen 4/2003-1/2004
*/
#define MODULE_BIT 0x00400000
@@ -1,5 +1,6 @@
/* Some commmon support functions */
/* Mark Watson 2/2000 */
/* Mark Watson 2/2000;
* Rudolf Cornelissen 1/2004 */
#define MODULE_BIT 0x00000800
@@ -17,12 +18,15 @@ void delay(bigtime_t i)
void nm_log(char *fmt, ...)
{
char buffer[1024];
char fname[64];
FILE *myhand;
va_list args;
myhand=fopen("/boot/home/" DRIVER_PREFIX ".accelerant.log","a+");
sprintf (fname, "/boot/home/" DRIVER_PREFIX ".accelerant.%d.log", accelerantIsClone);
myhand=fopen(fname,"a+");
if (myhand == NULL) return;
va_start(args,fmt);
vsprintf (buffer, fmt, args);
fprintf(myhand, "%s", buffer);
@@ -4,7 +4,7 @@
Other authors:
Mark Watson,
Rudolf Cornelissen 10/2002-12/2003.
Rudolf Cornelissen 10/2002-1/2004.
*/
#define MODULE_BIT 0x00800000
@@ -240,7 +240,18 @@ status_t CLONE_ACCELERANT(void *data) {
strcat(path, (const char *)data);
/* open the device, the permissions aren't important */
fd = open(path, B_READ_WRITE);
if (fd < 0) {
if (fd < 0)
{
/* we can't use LOG because we didn't get the shared_info struct.. */
char fname[64];
FILE *myhand = NULL;
sprintf (fname, "/boot/home/" DRIVER_PREFIX ".accelerant.0.log");
myhand=fopen(fname,"a+");
fprintf(myhand, "CLONE_ACCELERANT: couldn't open kerneldriver %s! Aborting.\n", path);
fclose(myhand);
/* abort with resultcode from open attempt on kerneldriver */
result = fd;
goto error0;
}
@@ -1,5 +1,6 @@
/* Some commmon support functions */
/* Mark Watson 2/2000 */
/* Mark Watson 2/2000;
* Rudolf Cornelissen 1/2004 */
#define MODULE_BIT 0x00000800
@@ -17,12 +18,15 @@ void delay(bigtime_t i)
void nv_log(char *fmt, ...)
{
char buffer[1024];
char fname[64];
FILE *myhand;
va_list args;
myhand=fopen("/boot/home/" DRIVER_PREFIX ".accelerant.log","a+");
sprintf (fname, "/boot/home/" DRIVER_PREFIX ".accelerant.%d.log", accelerantIsClone);
myhand=fopen(fname,"a+");
if (myhand == NULL) return;
va_start(args,fmt);
vsprintf (buffer, fmt, args);
fprintf(myhand, "%s", buffer);