Waitlisting Process

How are in-demand majors treated? If you are waitlisted at a university and had applied for CS as first choice and a little less popular major X in letters & science as the alternate major, once the seat becomes available , does it become available for CS or for major X? Or is the admission for “undeclared” major?