git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/x86 - Some extra logging in ACPICA shim
[tpg/acess2.git]
/
Usermode
/
Applications
/
init_src
/
main.c
diff --git
a/Usermode/Applications/init_src/main.c
b/Usermode/Applications/init_src/main.c
index
87eccde
..
ac1e848
100644
(file)
--- a/
Usermode/Applications/init_src/main.c
+++ b/
Usermode/Applications/init_src/main.c
@@
-252,7
+252,6
@@
int ProcessInittab(const char *Path)
goto lineError;
}
AddKTerminal(id, command);
goto lineError;
}
AddKTerminal(id, command);
- free(command);
}
else if(strcmp(cmdbuf, "stty") == 0 ) {
// stty <devpath> [78][NOE][012][bB]<baud> <command...>
}
else if(strcmp(cmdbuf, "stty") == 0 ) {
// stty <devpath> [78][NOE][012][bB]<baud> <command...>
@@
-290,7
+289,7
@@
int ProcessInittab(const char *Path)
if(!command)
goto lineError;
if(!command)
goto lineError;
- int handles[] = {0, 1,
2
};
+ int handles[] = {0, 1,
1
};
int pid = _SysSpawn(command[0], (const char **)command, NULL, 3, handles, NULL);
int retstatus;
_SysWaitTID(pid, &retstatus);
int pid = _SysSpawn(command[0], (const char **)command, NULL, 3, handles, NULL);
int retstatus;
_SysWaitTID(pid, &retstatus);
@@
-388,7
+387,7
@@
int AddSerialTerminal(const char *DevPathSegment, const char *ModeStr, char **Co
modeword |= (sbit - '0') << 3;
// Create info
modeword |= (sbit - '0') << 3;
// Create info
- const char DEVPREFIX[] = "/Devices/";
+ const char DEVPREFIX[] = "/Devices/
pts/serial
";
int pathlen = sizeof(DEVPREFIX) + strlen(DevPathSegment);
tInitProgram *ent = AllocateProgram(Command, PT_STERM, sizeof(struct sSTerm)+pathlen);
ent->TypeInfo.STerm.FormatBits = modeword;
int pathlen = sizeof(DEVPREFIX) + strlen(DevPathSegment);
tInitProgram *ent = AllocateProgram(Command, PT_STERM, sizeof(struct sSTerm)+pathlen);
ent->TypeInfo.STerm.FormatBits = modeword;
@@
-414,6
+413,21
@@
int SpawnCommand(int c_stdin, int c_stdout, int c_stderr, char **ArgV)
{
int handles[] = {c_stdin, c_stdout, c_stderr};
{
int handles[] = {c_stdin, c_stdout, c_stderr};
+ _SysDebug("Spawning '%s'", ArgV[0]);
+
+ if( c_stdin < 0 ) {
+ _SysDebug("SpawnCommand: stdin is invalid");
+ return 1;
+ }
+ if( c_stdout < 0 ) {
+ _SysDebug("SpawnCommand: stdout is invalid");
+ return 1;
+ }
+ if( c_stderr < 0 ) {
+ _SysDebug("SpawnCommand: stderr is invalid");
+ return 1;
+ }
+
int rv = _SysSpawn(ArgV[0], (const char **)ArgV, NULL, 3, handles, NULL);
_SysClose(c_stdin);
int rv = _SysSpawn(ArgV[0], (const char **)ArgV, NULL, 3, handles, NULL);
_SysClose(c_stdin);
@@
-427,7
+441,7
@@
int SpawnCommand(int c_stdin, int c_stdout, int c_stderr, char **ArgV)
int SpawnKTerm(tInitProgram *Program)
{
int SpawnKTerm(tInitProgram *Program)
{
- const char fmt[] = "/Devices/
VTerm/
%i";
+ const char fmt[] = "/Devices/
pts/vt
%i";
char path[sizeof(fmt)];
snprintf(path, sizeof(path), fmt, Program->TypeInfo.KTerm.ID);
char path[sizeof(fmt)];
snprintf(path, sizeof(path), fmt, Program->TypeInfo.KTerm.ID);
@@
-444,7
+458,7
@@
int SpawnSTerm(tInitProgram *Program)
int out = _SysOpen(Program->TypeInfo.STerm.Path, OPENFLAG_WRITE);
if(in == -1 || out == -1 ) {
int out = _SysOpen(Program->TypeInfo.STerm.Path, OPENFLAG_WRITE);
if(in == -1 || out == -1 ) {
- _SysDebug("Unable to open serial
'%s' for '%s'", Program->TypeInfo.STerm.Path, Program->Command
);
+ _SysDebug("Unable to open serial
port '%s'", Program->TypeInfo.STerm.Path
);
return -1;
}
return -1;
}
@@
-467,7
+481,8
@@
int SpawnDaemon(tInitProgram *Program)
int out = _SysOpen(Program->TypeInfo.Daemon.StdoutPath, OPENFLAG_WRITE);
int err = _SysOpen(Program->TypeInfo.Daemon.StderrPath, OPENFLAG_WRITE);
int out = _SysOpen(Program->TypeInfo.Daemon.StdoutPath, OPENFLAG_WRITE);
int err = _SysOpen(Program->TypeInfo.Daemon.StderrPath, OPENFLAG_WRITE);
- if( in == -1 || out == -1 || err == -1 ) {
+ if( in < 0 || out < 0 || err < 0 ) {
+ perror("SpawnDaemon");
_SysClose(in);
_SysClose(out);
_SysClose(err);
_SysClose(in);
_SysClose(out);
_SysClose(err);
@@
-477,8
+492,17
@@
int SpawnDaemon(tInitProgram *Program)
// Log spawn header
{
char buffer[101];
// Log spawn header
{
char buffer[101];
- size_t len = snprintf(buffer, 100, "[%
i] init spawning '%s'\n", _SysTimestamp(), Program->Command
);
+ size_t len = snprintf(buffer, 100, "[%
lli] init spawning ", _SysTimestamp()
);
_SysWrite(out, buffer, len);
_SysWrite(out, buffer, len);
+ char ch = '\'';
+ for( int i = 0; Program->Command[i]; i ++ )
+ {
+ _SysWrite(out, &ch, 1);
+ _SysWrite(out, Program->Command[i], strlen(Program->Command[i]));
+ _SysWrite(out, &ch, 1);
+ }
+ ch = '\n';
+ _SysWrite(out, &ch, 1);
}
return SpawnCommand(in, out, err, Program->Command);
}
return SpawnCommand(in, out, err, Program->Command);
UCC
git Repository :: git.ucc.asn.au