Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "getty"
-
fork() can fail: this is important
Ah, fork(). The way processes make more processes. Well, one of them, anyway. It seems I have another story to tell about it.
It can fail. Got that? Are you taking this seriously? You should. fork can fail. Just like malloc, it can fail. Neither of them fail often, but when they do, you can't just ignore it. You have to do something intelligent about it.
People seem to know that fork will return 0 if you're the child and some positive number if you're the parent -- that number is the child's pid. They sock this number away and then use it later.
Guess what happens when you don't test for failure? Yep, that's right, you probably treat "-1" (fork's error result) as a pid.
That's the beginning of the pain. The true pain comes later when it's time to send a signal. Maybe you want to shut down a child process.
Do you kill(pid, signal)? Maybe you do kill(pid, 9).
Do you know what happens when pid is -1? You really should. It's Important. Yes, with a capital I.
...
...
...
Here, I'll paste from the kill(2) man page on my Linux box.
If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), ...
See that? Killing "pid -1" is equivalent to massacring every other process you are permitted to signal. If you're root, that's probably everything. You live and init lives, but that's it. Everything else is gone gone gone.
Do you have code which manages processes? Have you ever found a machine totally dead except for the text console getty/login (which are respawned by init, naturally) and the process manager? Did you blame the oomkiller in the kernel?
It might not be the guilty party here. Go see if you killed -1.
Unix: just enough potholes and bear traps to keep an entire valley going.
Source: https://rachelbythebay.com/w/2014/...12 -
need a stock photo
go to getty images
damn, can't download without watermark, dont wanna pay them
well, let the AI generate it for me
The AI:5 -
Fuck it all to Hell today. I'm cutting into my mostly night time Xanax script at noon.
My boss just made my coworker remove his own copyrighted photo from our Trello board for internal development. The board is only used by the two of us for internal projects. He thinks that our C-level execs would get onto him, not my coworker, for us having a fucking photo of the Boston city skyline on our own, internal, never fucking seen by anyone but us, Trello board. It has fucking animated gifs from Giphy on it, but my fellow dev can't use his own god damn photo as the background.
We're a fucking marketing department for home building materials not a blog using Getty images without permission for fuck's sake.
Then on top of that fucking Cache rules are fucking up on Drupal views and a webform decided to just stop fucking working for submissions after about 26,000 successful ones and it corrupted the last 500 or so in the process.
Oh and fuck Varnish.4 -
Scheduled my ITIL exam, Getty everything setup and ready to go... log in... exam starts in 1 day and 0 hours...
I guess being a day early is better than a day late? -
Two things: I wrote a program for the BBC that uploaded all their Top Gear content to YouTube and I wrote a web app that the Getty Images global sales team use to sell content to all their customers. :)2
-
Seriously getty images, what is wrong with you. Usually it is bad enough that sign in forms say username or email and then only accept one of those two options. Getty images only allows for the username, so i enter that. Doesn't work. I use the forgot password function, have to enter username and email, doesn't work. Turns out the username is the email adress and what I entered was only the display name. Seriously, how stupid is that? What is the point of a username when you have a separate display name and just set it to the account email adress?
-
The moment you try new tty and forgot to enable both old and new before reboot....
(atleast, I have bootable usb)