summaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2024-04-17 16:45:46 +0800
committerBenBE <BenBE@geshi.org>2024-04-17 11:54:00 +0200
commita46b3f0a98c801b94df08598be0127e4d7db2aca (patch)
tree9a0e51e445dbb19685897d225ff847016f9c6761 /OpenFilesScreen.c
parent6f0adfab242f40e0a0e82445abac4e574c7a97e8 (diff)
Use 'fp' name for local 'FILE*' variables.
It is inappropriate to use the 'fd' name for 'FILE*' variables. POSIX file descriptiors are of type 'int' and are distinguished from ISO C stream pointers (type 'FILE*'). Rename these variables to 'fp', which is a preferred naming in POSIX. (Note that ISO C preferred the 'stream' name for the variables.) No code changes.
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r--OpenFilesScreen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c
index d6d663c0..08b3b3d6 100644
--- a/OpenFilesScreen.c
+++ b/OpenFilesScreen.c
@@ -138,13 +138,13 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
OpenFiles_FileData* fdata = NULL;
bool lsofIncludesFileSize = false;
- FILE* fd = fdopen(fdpair[0], "r");
- if (!fd) {
+ FILE* fp = fdopen(fdpair[0], "r");
+ if (!fp) {
pdata->error = 1;
return pdata;
}
for (;;) {
- char* line = String_readLine(fd);
+ char* line = String_readLine(fp);
if (!line) {
break;
}
@@ -212,7 +212,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
free(line);
}
- fclose(fd);
+ fclose(fp);
int wstatus;
while (waitpid(child, &wstatus, 0) == -1)

© 2014-2024 Faster IT GmbH | imprint | privacy policy