changeset 249:f26b3dcbc6db

tweak
author menikon
date Mon, 03 Feb 2020 15:41:24 +0900
parents c6cbe4711e02
children b40deb55b7db
files src/impl/fs_impl.cbc src/interface/fs.dg
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/impl/fs_impl.cbc	Mon Feb 03 15:29:54 2020 +0900
+++ b/src/impl/fs_impl.cbc	Mon Feb 03 15:41:24 2020 +0900
@@ -167,9 +167,9 @@
     goto next(...);
 }
 
-__code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(...)) {
-
-    goto next(...);
+__code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)) {
+    strncmp_val = strncmp(s, t, DIRSIZ);
+    goto next(strncmp_val, ...);
 }
 
 __code dirlookupfs_impl(struct inode* dp, char* name, uint* poff, __code next(...)) {
--- a/src/interface/fs.dg	Mon Feb 03 15:29:54 2020 +0900
+++ b/src/interface/fs.dg	Mon Feb 03 15:41:24 2020 +0900
@@ -17,6 +17,7 @@
     char* path;
     char* src;
     int namex_val;
+    int strncmp_val;
 
     __code readsb(Impl* fs, uint dev, struct superblock* sb, __code next(...));
     __code iinit(Impl* fs, __code next(...));
@@ -30,7 +31,7 @@
     __code stati(Impl* fs , struct inode* ip, struct stat* st, __code next(...));
     __code readi(Impl* fs, struct inode* ip, char* dst, uint off, uint n, __code next(...));
     __code writei(Impl* fs, struct inode* ip, char* src, uint off, uint n, __code next(...));
-    __code namecmp(Impl* fs, const char* s, const char* t, __code next(...));
+    __code namecmp(Impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...));
     __code dirlookup(struct inode* dp, char* name, uint* poff, __code next(...));
     __code dirlink(Impl* fs, struct inode* dp, char* name, uint inum, __code next(...));
     __code namei(Impl* fs, char* path, __code next(int namex_val, ...));