Skip to content

Commit cd019a7

Browse files
committed
- fix stdout hook mutex ?
1 parent eba515c commit cd019a7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

psp2shell_k/main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ void kpsp2shell_set_ready(int rdy) {
8484

8585
ready = rdy;
8686
// "unblock" update_kbuf
87-
if (ready == 1) {
88-
memset(kbuf, 0, BUF_SIZE);
89-
ksceKernelSignalSema(u_mutex, 1);
87+
if (ready == 0) {
9088
ksceKernelSignalSema(k_mutex, 1);
89+
ksceKernelSignalSema(u_mutex, 1);
9190
}
9291
}
9392

@@ -144,7 +143,7 @@ void set_hooks() {
144143
0xF2FF276E,
145144
0x34EFD876,
146145
_sceIoWrite);
147-
LOG("hook: sceIoWrite: 0x%08X\n", g_hooks[0]);
146+
//LOG("hook: sceIoWrite: 0x%08X\n", g_hooks[0]);
148147

149148
g_hooks[1] = taiHookFunctionExportForKernel(
150149
KERNEL_PID,
@@ -153,7 +152,7 @@ void set_hooks() {
153152
0x2DD91812,
154153
0xE5AA625C,
155154
_sceKernelGetStdout);
156-
LOG("hook: sceKernelGetStdout: 0x%08X\n", g_hooks[1]);
155+
//LOG("hook: sceKernelGetStdout: 0x%08X\n", g_hooks[1]);
157156

158157
EXIT_SYSCALL(state);
159158
}

psp2shell_m/source/cmd.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static ssize_t cmd_put(s_client *client, long size, char *name, char *dst) {
6464
ssize_t received = p2s_recv_file(client->cmd_sock, fd, size);
6565
s_close(fd);
6666

67-
psp2shell_print_color(COL_GREEN, "sent `%s` to `%s` (%i)", name, new_path, received);
67+
PRINT_OK("received `%s` to `%s` (%i)\n", name, new_path, received);
6868

6969
return received;
7070
}
@@ -157,7 +157,9 @@ static void cmd_reload(int sock, long size) {
157157
}
158158

159159
static void cmd_reset() {
160-
p2s_reset_running_app();
160+
if (p2s_reset_running_app() != 0) {
161+
PRINT_ERR("can't reset SceShell...\n");
162+
}
161163
}
162164

163165
static void cmd_cd(s_client *client, char *path) {
@@ -199,7 +201,7 @@ static void cmd_cd(s_client *client, char *path) {
199201
s_fileListEmpty(&client->fileList);
200202
int res = s_fileListGetEntries(&client->fileList, client->fileList.path);
201203
if (res < 0) {
202-
psp2shell_print_color(COL_RED, "could not cd to directory: %s\n", client->fileList.path);
204+
PRINT_ERR("could not cd to directory: %s\n", client->fileList.path);
203205
strncpy(client->fileList.path, oldPath, MAX_PATH_LENGTH);
204206
s_fileListGetEntries(&client->fileList, oldPath);
205207
}

psp2shell_m/source/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ static int thread_wait(SceSize args, void *argp) {
228228
static int thread_kbuf(SceSize args, void *argp) {
229229

230230
char buffer[512];
231-
memset(buffer, 0, 512);
232231

233232
while (!quit) {
234233

0 commit comments

Comments
 (0)