1514519512 J * Aiken__ ~Aiken@2001:44b8:2168:1000:b26e:bfff:fe2a:b951 1514519512 Q * Aiken Read error: Connection reset by peer 1514521017 J * Aiken ~Aiken@2001:44b8:2168:1000:b26e:bfff:fe2a:b951 1514521017 Q * Aiken__ Read error: Connection reset by peer 1514525233 Q * dom_ Quit: Quitte 1514531296 M * Bertl_oO off to bed now ... have a good one everyone! 1514531300 N * Bertl_oO Bertl_zZ 1514534275 M * Ghislain1 Guy-: well dsir_emit return a boolena not an integer 1514534328 M * Ghislain1 this is why i was thinking this was the way to correct "warning: comparison of constant ‘0’ with boolean expression is always false" 1514536543 M * Ghislain1 Bert_zZ: i dont know about c but the fact we test the dir, . and .. is that not what dir_emit_dots do ? 1514536598 M * Ghislain1 ok forget it does not seems to act on the same data 1514537140 M * Ghislain1 ok so i tested and done a test.c a booleen even !boolean cannot be <0 so this test will never ever do anything 1514537294 M * Guy- Ghislain1: there is no boolean type in C 1514537384 M * Ghislain1 the compiler say otherwise, also even if not true and false in old c are 1 and 0 so cannot be < 0 so this test has a problem, this logic is not working meaning there is a problem no ? 1514537422 M * Ghislain1 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) 1514537433 M * Ghislain1 sorry: static inline bool dir_emit(struct dir_context *ctx, 1514537450 M * Guy- I haven't looked at the code of dir_emit(); are you sure it can't return anything but 0 or 1? 1514537456 M * Guy- I imagine 'bool' is a typedef? 1514537466 M * Ghislain1 static inline bool is_root_inode(struct inode *inode) { return inode == inode->i_sb->s_root->d_inode; } 1514537474 M * Ghislain1 aahhhhhh 1514537490 M * Ghislain1 https://elixir.free-electrons.com/linux/v4.14.9/source/include/linux/fs.h 1514537495 M * Ghislain1 line 3347 1514537519 M * Ghislain1 it do only return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0; 1514537594 M * Guy- ah, bool is a new type, introduced in C99 1514537613 M * Guy- and indeed it can be either 0 or 1, so that <0 will never happen 1514537656 M * Ghislain1 yep so this vserver function proc_xid_iterate has a logic issue 1514537807 M * Ghislain1 this is a maze, ctx is dir_context, dir_context->actor is const filldir_t actor;, filldir_t is typedef int (*filldir_t) and here i am lost 1514537934 M * Guy- well, I'm looking at https://elixir.free-electrons.com/linux/v4.14.9/source/include/linux/fs.h#L3347 1514537947 M * Guy- and this code definitely returns a 0 or a 1 1514537960 M * Guy- because the return value is the result of an arithmetic comparison 1514537994 M * Ghislain1 like we say in french: cqfd 1514537998 M * Guy- this particular implementation of dir_emit() will never return a negative number 1514538018 M * Guy- it's QED in latin (and English) 1514538055 M * Ghislain1 oh, didn't know that thanks :) ! 1514538092 M * Ghislain1 so with that in mind how do we solve it 1514538119 M * Ghislain1 if (dir_emit(ctx, ".", 1, ino, DT_DIR) == true) or if (dir_emit(ctx, ".", 1, ino, DT_DIR) ) 1514538136 M * Guy- that bit of code you pasted earlier looks like an unconditional "goto out" to me 1514538164 M * Guy- since dir_emit() will never be <0, the if will always be true, thus the goto branch will always be taken 1514538173 M * Guy- is that incorrect? 1514538184 M * Guy- I have no idea what the intention of the code was 1514538191 M * Ghislain1 we need a Bertl or Daniel_hozac look on it 1514538201 M * Guy- where is this code from? 1514538206 M * Ghislain1 perhaps they will know why this "if" was here 1514538220 M * Ghislain1 vserver/proc.c 1514538244 M * Ghislain1 in proc_xid_iterate 1514538290 M * Ghislain1 that is called in proc_xid_file_operations 1514538301 M * Ghislain1 that seems to never be called ever 1514538416 M * Ghislain1 well proc_xid_file_operations can only be found in this file, this is the definition but i cannot find it anywhere in the code 1514538432 M * Ghislain1 so this mean this function is not used at all or that i missed something 1514538547 M * Guy- my feeling is that the <0 test is unnecessary 1514538634 M * Ghislain1 my feeling is that this entire function is legacy code not used anywhere 1514538810 M * Ghislain1 well was a cool brainstorming 1514538814 M * Ghislain1 thanks gcc ! 1514538827 M * Ghislain1 and thanks Guy-: :) 1514539029 M * Guy- de rien :) 1514539093 M * Ghislain1 eheh 1514539367 Q * pixel_yo Remote host closed the connection 1514539372 J * pixel_yo ~pixel@v22017013027542729.megasrv.de 1514547025 Q * padde Remote host closed the connection 1514547168 J * padde ~padde@patrick-nagel.net 1514556726 N * Bertl_zZ Bertl_oO 1514574938 Q * obeardly Ping timeout: 480 seconds 1514578918 J * fstd_ ~fstd@xdsl-87-78-139-48.netcologne.de 1514579369 Q * fstd Ping timeout: 480 seconds 1514579369 N * fstd_ fstd 1514583281 J * aj__ ~aj@p2003008E6C12B300989B1AB1EA2AFD6C.dip0.t-ipconnect.de