logs archiveBotHelp.net / Freenode / #2f30 / 2015 / September / 22 / 1
paolos1956
#2f30 :http://2f30.org
biniar
Evil_Bob: when creating sites now, must make non-JavaScript mode :P
FRIGN
They found Evil_Bob at the library
https://www.youtube.com/watch?v=ohJW7E_jrKg
at 2:45
biniar
FRIGN: you know you can link to the timestamp in the video
https://www.youtube.com/watch?v=ohJW7E_jrKg
FRIGN
yeah, but that's jewish
and it's not directly visible
:P
biniar
https://youtu.be/ohJW7E_jrKg?t=167
FRIGN: you're welcome :D
Evil_Bob
FRIGN: i wish, i bet hes crushing that pu**y 24/7
loool
(the one with the glasses)
FRIGN
yeah
Evil_Bob
bbl sleep :)
dzervas
yooo
Drakevr
shouyo dzervas
yo*
garbage from another input, creeped there too :p
dzervas
XD
i hope your pass 3:D
FRIGN
lol
gn8 guys :)
stateless
morning
k0ga
morning
stateless
http://www.tedunangst.com/flak/post/rough-idling
retard
nice
FRIGN
hey guys
stateless: DWM :DDD
stateless: check this out
st build options:
CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.6" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = cc
CC st.c
st.c: In function 'ttynew':
st.c:1434:3: warning: ignoring return value of 'dup', declared with attribute warn_unused_result [-Wunused-result]
dup(cmdfd);
^
CC -o st
I get this warning every time and looked at ttynew()
so we're just calling dup() in there without storing the arg somewhere.
To me this looks like calling malloc without getting the adres.
*adress
What's the purpose of that?
k0ga
FRIGN: this is a long discussion
dup is used there for its lateral effect
stateless
FRIGN, magic
:P
FRIGN
care to elaborate, k0ga? :)
k0ga
stateless: what do you think about it?
stateless
k0ga, I haven't looked at the code, don't know what you are talking about
k0ga
dup duplicate its parameter (a file descriptor) into the lowest free position of the descriptor table
and it returns it
stateless
thank you for explaining dup
:P
k0ga
if you do something like:
close(0); dup(myfile);
you are converting myfile in stdin
and it is stupid to take the returned value of dup
but gcc is ever more stupid and warn about it
stateless
yes dup is always used like this tbh, preceeded by a close
FRIGN
yo, maybe this is a threadsafe issue
stateless
there is only one thread here
FRIGN
"what if this thread inserts another filedesc between the close and dup..."
just trying to realize what the gcc-guys thought
why they warn about it
stateless
that's why dup2 was created
FRIGN
thing is, dup can fail
stateless
so you can do it atomically
not really in this case
FRIGN
maybe we could at least do a: if (dup() < 0) die("dup %s",...);
stateless
cause a) you don't have multiple threads b) the fd is always valid and c) you close one fd and dup another so you also avoid EMFILE
k0ga
FRIGN: it is a common UNIX pattern
FRIGN
ah I see
k0ga
and yes, if you want to avoid the warning, you can use dup2
FRIGN
checked the manpage again
stateless
k0ga, a common unix pattern is also to not check close(2) :P
FRIGN
but what is the disadvantage of dup2? why do we have dup here then?
k0ga
or take the return value in some dummy variable
FRIGN
everywhere else, dup2 is used
k0ga
FRIGN: change it to dup2, I don't care
(if you care about it)
stateless
FRIGN, there is no disadvantage
FRIGN
okay
stateless
you can switch it
FRIGN
so I change:
close(0); dup(cmdfd); into
dup2(cmdfd, 0); ?
stateless
yes
FRIGN
okay
well, we save one LOC!!!!
I'll call Anselm
he needs to update his LOC-graph
http://dl.sta.li/slcon/2013/slcon-2013-0-arg-welcome_to_the_future_of_dwm.webm
remember? :p
stateless
FRIGN, note dup2 also returns the fd
check if you get the warning though :P
« prev 1 2 3 4 next »